diff --git a/modules/backend/formwidgets/codeeditor/assets/js/build-min.js b/modules/backend/formwidgets/codeeditor/assets/js/build-min.js index 9ca99cb1b..3fa617592 100644 --- a/modules/backend/formwidgets/codeeditor/assets/js/build-min.js +++ b/modules/backend/formwidgets/codeeditor/assets/js/build-min.js @@ -4267,10 +4267,6 @@ if(this.isFullscreen){$('body').css({overflow:'hidden'})} else{$('body').css({overflow:'inherit'})} this.editor.resize() this.editor.focus()} -+function(exports){if(exports.ace&&typeof exports.ace.require=='function'){var emmetExt=exports.ace.require('ace/ext/emmet') -if(emmetExt&&emmetExt.AceEmmetEditor&&emmetExt.AceEmmetEditor.prototype.getSyntax){var coreGetSyntax=emmetExt.AceEmmetEditor.prototype.getSyntax -emmetExt.AceEmmetEditor.prototype.getSyntax=function(){var $syntax=$.proxy(coreGetSyntax,this)() -return $syntax=='twig'?'html':$syntax};}}}(window) var old=$.fn.codeEditor $.fn.codeEditor=function(option){var args=Array.prototype.slice.call(arguments,1),result this.each(function(){var $this=$(this) @@ -4287,4 +4283,7 @@ $.oc={} $.oc.codeEditorExtensionModes={'htm':'html','html':'html','md':'markdown','txt':'plain_text','js':'javascript','less':'less','scss':'scss','sass':'sass','css':'css'} $.fn.codeEditor.noConflict=function(){$.fn.codeEditor=old return this} -$(document).render(function(){$('[data-control="codeeditor"]').codeEditor()})}(window.jQuery); \ No newline at end of file +$(document).render(function(){$('[data-control="codeeditor"]').codeEditor()});+function(exports){if(exports.ace&&typeof exports.ace.require=='function'){var emmetExt=exports.ace.require('ace/ext/emmet') +if(emmetExt&&emmetExt.AceEmmetEditor&&emmetExt.AceEmmetEditor.prototype.getSyntax){var coreGetSyntax=emmetExt.AceEmmetEditor.prototype.getSyntax +emmetExt.AceEmmetEditor.prototype.getSyntax=function(){var $syntax=$.proxy(coreGetSyntax,this)() +return $syntax=='twig'?'html':$syntax};}}}(window)}(window.jQuery); \ No newline at end of file diff --git a/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js b/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js index d19228864..f429889a9 100644 --- a/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js +++ b/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js @@ -338,24 +338,6 @@ this.editor.focus() } - // FIX EMMET HTML WHEN SYNTAX IS TWIG - // ================================== - - +function (exports) { - if (exports.ace && typeof exports.ace.require == 'function') { - var emmetExt = exports.ace.require('ace/ext/emmet') - - if (emmetExt && emmetExt.AceEmmetEditor && emmetExt.AceEmmetEditor.prototype.getSyntax) { - var coreGetSyntax = emmetExt.AceEmmetEditor.prototype.getSyntax - - emmetExt.AceEmmetEditor.prototype.getSyntax = function () { - var $syntax = $.proxy(coreGetSyntax, this)() - return $syntax == 'twig' ? 'html' : $syntax - }; - } - } - }(window) - // CODEEDITOR PLUGIN DEFINITION // ============================ @@ -407,6 +389,24 @@ // =============== $(document).render(function () { $('[data-control="codeeditor"]').codeEditor() - }) + }); + + // FIX EMMET HTML WHEN SYNTAX IS TWIG + // ================================== + + +function (exports) { + if (exports.ace && typeof exports.ace.require == 'function') { + var emmetExt = exports.ace.require('ace/ext/emmet') + + if (emmetExt && emmetExt.AceEmmetEditor && emmetExt.AceEmmetEditor.prototype.getSyntax) { + var coreGetSyntax = emmetExt.AceEmmetEditor.prototype.getSyntax + + emmetExt.AceEmmetEditor.prototype.getSyntax = function () { + var $syntax = $.proxy(coreGetSyntax, this)() + return $syntax == 'twig' ? 'html' : $syntax + }; + } + } + }(window) }(window.jQuery); diff --git a/modules/system/assets/ui/js/drag.scroll.js b/modules/system/assets/ui/js/drag.scroll.js index 0e4f290ca..4a0b00890 100644 --- a/modules/system/assets/ui/js/drag.scroll.js +++ b/modules/system/assets/ui/js/drag.scroll.js @@ -294,14 +294,14 @@ var self = this, params = { - duration: 300, - queue: false, - complete: function(){ - self.fixScrollClasses() - if (callback !== undefined) - callback() + duration: 300, + queue: false, + complete: function(){ + self.fixScrollClasses() + if (callback !== undefined) + callback() + } } - } params = $.extend(params, options || {}) @@ -314,20 +314,23 @@ if (offset < 0) { this.el.animate({'scrollLeft': $el.get(0).offsetLeft}, params) animated = true - } else { + } + else { offset = $el.get(0).offsetLeft + $el.width() - (this.el.scrollLeft() + this.el.width()) if (offset > 0) { this.el.animate({'scrollLeft': $el.get(0).offsetLeft + $el.width() - this.el.width()}, params) animated = true } } - } else { + } + else { offset = $el.get(0).offsetTop - this.el.scrollTop() if (offset < 0) { this.el.animate({'scrollTop': $el.get(0).offsetTop}, params) animated = true - } else { + } + else { offset = $el.get(0).offsetTop - (this.el.scrollTop() + this.el.height()) if (offset > 0) { this.el.animate({'scrollTop': $el.get(0).offsetTop + $el.height() - this.el.height()}, params) @@ -336,8 +339,9 @@ } } - if (!animated && callback !== undefined) + if (!animated && callback !== undefined) { callback() + } } DragScroll.prototype.dispose = function() { diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index b5d0ab812..aff7d5105 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -1540,15 +1540,17 @@ params=$.extend(params,options||{}) var offset=0,animated=false if(!this.options.vertical){offset=$el.get(0).offsetLeft-this.el.scrollLeft() if(offset<0){this.el.animate({'scrollLeft':$el.get(0).offsetLeft},params) -animated=true}else{offset=$el.get(0).offsetLeft+$el.width()-(this.el.scrollLeft()+this.el.width()) +animated=true} +else{offset=$el.get(0).offsetLeft+$el.width()-(this.el.scrollLeft()+this.el.width()) if(offset>0){this.el.animate({'scrollLeft':$el.get(0).offsetLeft+$el.width()-this.el.width()},params) -animated=true}}}else{offset=$el.get(0).offsetTop-this.el.scrollTop() +animated=true}}} +else{offset=$el.get(0).offsetTop-this.el.scrollTop() if(offset<0){this.el.animate({'scrollTop':$el.get(0).offsetTop},params) -animated=true}else{offset=$el.get(0).offsetTop-(this.el.scrollTop()+this.el.height()) +animated=true} +else{offset=$el.get(0).offsetTop-(this.el.scrollTop()+this.el.height()) if(offset>0){this.el.animate({'scrollTop':$el.get(0).offsetTop+$el.height()-this.el.height()},params) animated=true}}} -if(!animated&&callback!==undefined) -callback()} +if(!animated&&callback!==undefined){callback()}} DragScroll.prototype.dispose=function(){this.scrollClassContainer=null $(document).off('ready',this.proxy(this.fixScrollClasses)) $(window).off('resize',this.proxy(this.fixScrollClasses))