From 502ae9d2a04ca4026d7c60f9761eb341c980a471 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Tue, 26 May 2015 19:13:46 +0100 Subject: [PATCH] Closes #669 --- app/Http/Controllers/Admin/ApiController.php | 9 ++--- .../js/{all-c95bf9ff.js => all-d0596004.js} | 5 +-- public/build/rev-manifest.json | 2 +- resources/assets/js/app.js | 34 ++++++++++--------- 4 files changed, 27 insertions(+), 23 deletions(-) rename public/build/dist/js/{all-c95bf9ff.js => all-d0596004.js} (98%) diff --git a/app/Http/Controllers/Admin/ApiController.php b/app/Http/Controllers/Admin/ApiController.php index 2d990142..36319d3d 100644 --- a/app/Http/Controllers/Admin/ApiController.php +++ b/app/Http/Controllers/Admin/ApiController.php @@ -46,8 +46,9 @@ class ApiController extends AbstractController */ public function postUpdateComponentOrder() { - $componentData = Binput::all(); - foreach ($componentData['ids'] as $order => $componentId) { + $componentData = Binput::get('ids'); + return $componentData; + foreach ($componentData as $order => $componentId) { // Ordering should be 1-based, data comes in 0-based Component::find($componentId)->update(['order' => $order + 1]); } @@ -62,8 +63,8 @@ class ApiController extends AbstractController */ public function postUpdateComponentGroupOrder() { - $groupData = Binput::all(); - foreach ($groupData['ids'] as $order => $groupId) { + $groupData = Binput::get('ids'); + foreach ($groupData as $order => $groupId) { ComponentGroup::find($groupId)->update([ 'order' => $order + 1, ]); diff --git a/public/build/dist/js/all-c95bf9ff.js b/public/build/dist/js/all-d0596004.js similarity index 98% rename from public/build/dist/js/all-c95bf9ff.js rename to public/build/dist/js/all-d0596004.js index fb495aa1..2be213a6 100644 --- a/public/build/dist/js/all-c95bf9ff.js +++ b/public/build/dist/js/all-d0596004.js @@ -13,5 +13,6 @@ criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,str }},i={on:function(e,n,i){if(!t(this,"on",e,[n,i])||!n)return this;this._events||(this._events={});var a=this._events[e]||(this._events[e]=[]);return a.push({callback:n,context:i,ctx:i||this}),this},once:function(e,n,i){if(!t(this,"once",e,[n,i])||!n)return this;var a=this,r=_.once(function(){a.off(e,r),n.apply(this,arguments)});return r._callback=n,this.on(e,r,i),this},off:function(e,n,i){var a,r,s,o,l,u,d,c;if(!this._events||!t(this,"off",e,[n,i]))return this;if(!e&&!n&&!i)return this._events={},this;for(o=e?[e]:_.keys(this._events),l=0,u=o.length;u>l;l++)if(e=o[l],a=this._events[e]){if(s=[],n||i)for(d=0,c=a.length;c>d;d++)r=a[d],(n&&n!==r.callback&&n!==r.callback._callback||i&&i!==r.context)&&s.push(r);this._events[e]=s}return this},trigger:function(e){if(!this._events)return this;var i=Array.prototype.slice.call(arguments,1);if(!t(this,"trigger",e,i))return this;var a=this._events[e],r=this._events.all;return a&&n(a,i),r&&n(r,arguments),this},listenTo:function(e,t,n){var i=this._listeners||(this._listeners={}),a=e._listenerId||(e._listenerId=_.uniqueId("l"));return i[a]=e,e.on(t,"object"==typeof t?this:n,this),this},stopListening:function(e,t,n){var i=this._listeners;if(i){if(e)e.off(t,"object"==typeof t?this:n,this),t||n||delete i[e._listenerId];else{"object"==typeof t&&(n=this);for(var a in i)i[a].off(t,n,this);this._listeners={}}return this}}};return i.bind=i.on,i.unbind=i.off,i};return e()}(),function(){var e,t,n,i,a,r,s,o,l,u,d,c={}.hasOwnProperty,h=function(e,t){function n(){this.constructor=e}for(var i in t)c.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},f=[].slice,p=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};e=jQuery,r=null!=(l=window._)?l:window.Messenger._,i=null!=(u="undefined"!=typeof Backbone&&null!==Backbone?Backbone.Events:void 0)?u:window.Messenger.Events,n=function(){function t(t){e.extend(this,i),r.isObject(t)&&(t.el&&this.setElement(t.el),this.model=t.model),this.initialize.apply(this,arguments)}return t.prototype.setElement=function(t){return this.$el=e(t),this.el=this.$el[0]},t.prototype.delegateEvents=function(e){var t,n,i,a,s,o,l;if(e||(e=r.result(this,"events"))){this.undelegateEvents(),t=/^(\S+)\s*(.*)$/,l=[];for(i in e){if(s=e[i],r.isFunction(s)||(s=this[e[i]]),!s)throw new Error('Method "'+e[i]+'" does not exist');a=i.match(t),n=a[1],o=a[2],s=r.bind(s,this),n+=".delegateEvents"+this.cid,l.push(""===o?this.jqon(n,s):this.jqon(n,o,s))}return l}},t.prototype.jqon=function(e,t,n){var i;return null!=this.$el.on?(i=this.$el).on.apply(i,arguments):(null==n&&(n=t,t=void 0),null!=t?this.$el.delegate(t,e,n):this.$el.bind(e,n))},t.prototype.jqoff=function(e){var t;return null!=this.$el.off?(t=this.$el).off.apply(t,arguments):(this.$el.undelegate(),this.$el.unbind(e))},t.prototype.undelegateEvents=function(){return this.jqoff(".delegateEvents"+this.cid)},t.prototype.remove=function(){return this.undelegateEvents(),this.$el.remove()},t}(),s=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return h(n,t),n.prototype.defaults={hideAfter:10,scroll:!0,closeButtonText:"×"},n.prototype.initialize=function(t){return null==t&&(t={}),this.shown=!1,this.rendered=!1,this.messenger=t.messenger,this.options=e.extend({},this.options,t,this.defaults)},n.prototype.show=function(){var e;return this.rendered||this.render(),this.$message.removeClass("messenger-hidden"),e=this.shown,this.shown=!0,e?void 0:this.trigger("show")},n.prototype.hide=function(){var e;if(this.rendered)return this.$message.addClass("messenger-hidden"),e=this.shown,this.shown=!1,e?this.trigger("hide"):void 0},n.prototype.cancel=function(){return this.hide()},n.prototype.update=function(t){var n,i=this;return r.isString(t)&&(t={message:t}),e.extend(this.options,t),this.lastUpdate=new Date,this.rendered=!1,this.events=null!=(n=this.options.events)?n:{},this.render(),this.actionsToEvents(),this.delegateEvents(),this.checkClickable(),this.options.hideAfter?(this.$message.addClass("messenger-will-hide-after"),null!=this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(function(){return i.hide()},1e3*this.options.hideAfter)):this.$message.removeClass("messenger-will-hide-after"),this.options.hideOnNavigate?(this.$message.addClass("messenger-will-hide-on-navigate"),null!=("undefined"!=typeof Backbone&&null!==Backbone?Backbone.history:void 0)&&Backbone.history.on("route",function(){return i.hide()})):this.$message.removeClass("messenger-will-hide-on-navigate"),this.trigger("update",this)},n.prototype.scrollTo=function(){return this.options.scroll?e.scrollTo(this.$el,{duration:400,offset:{left:0,top:-20}}):void 0},n.prototype.timeSinceUpdate=function(){return this.lastUpdate?new Date-this.lastUpdate:null},n.prototype.actionsToEvents=function(){var e,t,n,i,a=this;n=this.options.actions,i=[];for(t in n)e=n[t],i.push(this.events['click [data-action="'+t+'"] a']=function(e){return function(n){return n.preventDefault(),n.stopPropagation(),a.trigger("action:"+t,e,n),e.action.call(a,n,a)}}(e));return i},n.prototype.checkClickable=function(){var e,t,n,i;n=this.events,i=[];for(t in n)e=n[t],i.push("click"===t?this.$message.addClass("messenger-clickable"):void 0);return i},n.prototype.undelegateEvents=function(){var e;return n.__super__.undelegateEvents.apply(this,arguments),null!=(e=this.$message)?e.removeClass("messenger-clickable"):void 0},n.prototype.parseActions=function(){var t,n,i,a,r,s;n=[],r=this.options.actions;for(a in r)t=r[a],i=e.extend({},t),i.name=a,null==(s=i.label)&&(i.label=a),n.push(i);return n},n.prototype.template=function(t){var n,i,a,r,s,o,l,u,d,c,h=this;for(s=e("
"),t.showCloseButton&&(a=e('