tour-edit.min.js 2 KB
Newer Older
nabil el mahiri committed
1 2
!function(){"use strict";angular.module("tour-edit",[]).controller("TourEditCtrl",["$scope","$modal",function(a,b){function c(b){j.destinations&&angular.isArray(j.destinations)||(j.destinations=[]),-1===j.destinations.indexOf(b)&&j.destinations.push(b),delete a.edit.destination}function d(a){j.photos.push(a)}function e(a){j.photos.splice(a,1)}function f(a){g(j.photos[a])}function g(c){b.open({templateUrl:"photoPrompDialog.html",controller:"PhotoEditCtrl",scope:a,resolve:{photos:function(){return j.photos},photo:function(){return c}}}).result.then(d)}function h(a){if(j.rates||(j.rates=[]),a.original&&j.rates.indexOf(a.original)>-1){var b=j.rates.indexOf(a.original);angular.extend(j.rates[b],a.copy)}else j.rates.push(a.copy)}function i(a){b.open({templateUrl:"edit-rate-dialog",controller:"RateEditCtrl",size:"lg",resolve:{rate:function(){return a?{original:a,copy:angular.copy(a)}:{original:null,copy:null}}}}).result.then(h)}a.title="{{copy.title}}";var j=a.copy;a.edit={},j.photos||(j.photos=[]),a.promptPhoto=g,a.editPhoto=f,a.removePhoto=e,a.manageRates=i,a.addDestination=c}]).controller("PhotoEditCtrl",["$scope","$modalInstance","photos","photo",function(a,b,c,d){d&&(a.photo=d),a.ok=function(a){console.log(a),b.close(a)},a.cancel=function(){b.dismiss("cancel")}}]).controller("RateEditCtrl",["$scope","$modalInstance","rate",function(a,b,c){var d=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"];a.rate=c,c.copy=c.copy||{type:"dates",week:{},dates:[],rates:{std:0,single:0,child:0,baby:0}},a.selection=c.copy,a.rateSelectionTypes=["dates","period"],a.rateLabels={std:"Demi Double",single:"Single",child:"Enfant",baby:"Bébé"},a.options={week:d},a.dateToAdd={},a.addDate=function(){a.selection.dates.push(a.dateToAdd.value),delete a.dateToAdd.value,console.log(a.selection.dates)},a.toggleWeekDay=function(b){a.selection.week[b]=!a.selection.week[b]},a.selectionType=function(b){b!==a.selection.type&&(a.selection.type=b)},a.ok=function(){b.close(c)},a.cancel=function(){b.dismiss("cancel")}}])}();
//# sourceMappingURL=tour-edit.min.js.map