Make Inspector element available outside of dragscroll contexts
Credit to @Farrow. Update to the javascript cmsPage onInspectorShowing event handler to make it check whether the event target has a dragScroll attached to it (which it previously assumed it did). This allows the inspector to be used in other locations on the backend which are outside of a dragscroll without causing a javascript error.
This commit is contained in:
parent
a7bbfe2d9d
commit
52fe8586e3
|
|
@ -386,7 +386,12 @@
|
|||
}
|
||||
|
||||
CmsPage.prototype.onInspectorShowing = function(ev, data) {
|
||||
$(ev.currentTarget).closest('[data-control="toolbar"]').data('oc.dragScroll').goToElement(ev.currentTarget, data.callback)
|
||||
var $dragScroll = $(ev.currentTarget).closest('[data-control="toolbar"]').data('oc.dragScroll')
|
||||
if ($dragScroll) {
|
||||
$dragScroll.goToElement(ev.currentTarget, data.callback)
|
||||
} else {
|
||||
data.callback();
|
||||
}
|
||||
|
||||
ev.stopPropagation()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue