From 3b42ceba492be606c37ed223a9927851425d74d1 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Thu, 7 Jun 2018 07:25:00 -0500 Subject: [PATCH] Garnish 0.1.24 (#2964) --- CHANGELOG-v3.md | 1 + lib/garnishjs/garnish.js | 2 +- lib/garnishjs/garnish.js.map | 2 +- package-lock.json | 6 +++--- package.json | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index e7b6750af7a..b5348493e54 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -4,6 +4,7 @@ ### Changed - Improved the output of `craft\helpers\DateTimeHelper::humanDurationFromInterval()`. +- Updated Garnish to 0.1.24. ### Fixed - Fixed JavaScript errors that could occur in the Control Panel on pages with Ajax requests. ([#2966](https://github.com/craftcms/cms/issues/2966)) diff --git a/lib/garnishjs/garnish.js b/lib/garnishjs/garnish.js index d428bc0c668..f572eedba5b 100644 --- a/lib/garnishjs/garnish.js +++ b/lib/garnishjs/garnish.js @@ -1,2 +1,2 @@ -!function(T){var e,i,t,g=function(){};if(g.extend=function(t,e){var i=g.prototype.extend;g._prototyping=!0;var s=new this;i.call(s,t),s.base=function(){},delete g._prototyping;var n=s.constructor,h=s.constructor=function(){if(!g._prototyping)if(this._constructing||this.constructor==h)this._constructing=!0,n.apply(this,arguments),delete this._constructing;else if(null!=arguments[0])return(arguments[0].extend||i).call(arguments[0],s)};return h.ancestor=this,h.extend=this.extend,h.forEach=this.forEach,h.implement=this.implement,h.prototype=s,h.toString=this.toString,h.valueOf=function(t){return"object"==t?h:n.valueOf()},i.call(h,e),"function"==typeof h.init&&h.init(),h},g.prototype={extend:function(t,e){if(1=Garnish.hitTest._x1&&t=Garnish.hitTest._y1&&eGarnish.getBodyScrollTop._maxScrollTop&&(Garnish.getBodyScrollTop._scrollTop=Garnish.getBodyScrollTop._maxScrollTop)),Garnish.getBodyScrollTop._scrollTop},requestAnimationFrame:(i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return i(t)}),cancelAnimationFrame:(e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return e(t)}),scrollContainerToElement:function(t,e){var i;if(void 0===e)s=(i=T(t)).scrollParent();else{var s=T(t);i=T(e)}"HTML"!==s.prop("nodeName")&&s[0]!==Garnish.$doc[0]||(s=Garnish.$win);var n,h=s.scrollTop(),o=i.offset().top,r=!1;if((n=s[0]===window?o-h:o-s.offset().top)<0)r=h+n-10;else{var a=i.outerHeight(),l=s[0]===window?window.innerHeight:s[0].clientHeight;l :last-child",this).addClass("last"),s().listenTo(this,n)},teardown:function(){if(this===window)return!1;s().removeListener(this,n)}}}),jQuery.each(["activate","textchange","resize"],function(t,i){jQuery.fn[i]=function(t,e){return 0this.drag._maxMouseScrollY&&(this.drag._scrollProperty="scrollTop",this.drag._scrollAxis="Y",this.drag._scrollDist=Math.round((this.mouseY-this.drag._maxMouseScrollY)/2)))),this.drag._scrollProperty||this.settings.axis===Garnish.Y_AXIS||(this.drag._winScrollLeft=Garnish.$win.scrollLeft(),this.drag._minMouseScrollX=this.drag._winScrollLeft+Garnish.BaseDrag.windowScrollTargetSize,this.mouseXthis.drag._maxMouseScrollX&&(this.drag._scrollProperty="scrollLeft",this.drag._scrollAxis="X",this.drag._scrollDist=Math.round((this.mouseX-this.drag._maxMouseScrollX)/2)))),this.drag._scrollProperty?(this.scrollProperty||(this.scrollProxy||(this.scrollProxy=T.proxy(this,"_scrollWindow")),this.scrollFrame&&(Garnish.cancelAnimationFrame(this.scrollFrame),this.scrollFrame=null),this.scrollFrame=Garnish.requestAnimationFrame(this.scrollProxy)),this.scrollProperty=this.drag._scrollProperty,this.scrollAxis=this.drag._scrollAxis,this.scrollDist=this.drag._scrollDist):this._cancelWindowScroll()),this.onDrag()},stopDragging:function(){this.dragging=!1,this.onDragStop(),this._cancelWindowScroll()},addItems:function(t){t=T.makeArray(t);for(var e=0;e=Garnish.BaseDrag.minMouseDist&&this.startDragging()),this.dragging&&this.drag(!0)},_handleMouseUp:function(t){this.removeAllListeners(Garnish.$doc),this.dragging&&this.stopDragging(),this.$targetItem=null},_scrollWindow:function(){this._.scrollPos=Garnish.$scrollContainer[this.scrollProperty](),Garnish.$scrollContainer[this.scrollProperty](this._.scrollPos+this.scrollDist),this["mouse"+this.scrollAxis]-=this._.scrollPos-Garnish.$scrollContainer[this.scrollProperty](),this["realMouse"+this.scrollAxis]=this["mouse"+this.scrollAxis],this.drag(),this.scrollFrame=Garnish.requestAnimationFrame(this.scrollProxy)},_cancelWindowScroll:function(){this.scrollFrame&&(Garnish.cancelAnimationFrame(this.scrollFrame),this.scrollFrame=null),this.scrollProperty=null,this.scrollAxis=null,this.scrollDist=null},_deinitItem:function(t){this.removeAllListeners(t),T.removeData(t,"drag")}},{minMouseDist:1,windowScrollTargetSize:25,defaults:{handle:null,axis:null,ignoreHandleSelector:"input, textarea, button, select, .btn",onDragStart:T.noop,onDrag:T.noop,onDragStop:T.noop}}),Garnish.CheckboxSelect=Garnish.Base.extend({$container:null,$all:null,$options:null,init:function(t){this.$container=T(t),this.$container.data("checkboxSelect")&&(Garnish.log("Double-instantiating a checkbox select on an element"),this.$container.data("checkbox-select").destroy()),this.$container.data("checkboxSelect",this);var e=this.$container.find("input");this.$all=e.filter(".all:first"),this.$options=e.not(this.$all),this.addListener(this.$all,"change","onAllChange")},onAllChange:function(){var t=this.$all.prop("checked");this.$options.prop({checked:t,disabled:t})},destroy:function(){this.$container.removeData("checkboxSelect"),this.base()}}),Garnish.ContextMenu=Garnish.Base.extend({$target:null,options:null,$menu:null,showingMenu:!1,init:function(t,e,i){this.$target=T(t),this.$target.data("contextmenu")&&(Garnish.log("Double-instantiating a context menu on an element"),this.$target.data("contextmenu").destroy()),this.$target.data("contextmenu",this),this.options=e,this.setSettings(i,Garnish.ContextMenu.defaults),Garnish.ContextMenu.counter++,this.enable()},buildMenu:function(){this.$menu=T('