Fixes the full screen button in code editor
This commit is contained in:
parent
7aea60f11d
commit
beca2dddc2
|
|
@ -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);
|
||||
$(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);
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue