: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @class elfindernavdock - elFinder container for preview etc at below the navbar
jQuery.fn.elfindernavdock = function(fm, opts) {
this.not('.elfinder-navdock').each(function() {
var self = jQuery(this).hide().addClass('ui-state-default elfinder-navdock touch-punch'),
wz = node.children('.elfinder-workzone').append(self),
resize = function(to, h) {
var curH = h || self.height(),
len = Object.keys(sizeSyncs).length,
calc = len? diff / len : 0,
ovf = self.css('overflow');
self.css('overflow', 'hidden');
jQuery.each(sizeSyncs, function(id, n) {
n.height(n.height() + calc).trigger('resize.' + fm.namespace);
self.css('overflow', ovf);
handle = jQuery('<div class="ui-front ui-resizable-handle ui-resizable-n"></div>').appendTo(self),
initMaxHeight = (parseInt(opts.initMaxHeight) || 50) / 100,
maxHeight = (parseInt(opts.maxHeight) || 90) / 100,
self.data('addNode', function(cNode, opts) {
var wzH = fm.getUI('workzone').height(),
imaxH = wzH * initMaxHeight,
cNode.attr('id', fm.namespace+'-navdock-' + (+new Date()));
opts.sizeSync && (sizeSyncs[cNode.attr('id')] = cNode);
tH = curH + cNode.outerHeight(true);
self.resizable('enable').height(tH).show();
mH = fm.storage('navdockHeight');
tH = tH > imaxH? imaxH : tH;
resize(Math.min(tH, wzH * maxHeight));
}).data('removeNode', function(nodeId, appendTo) {
var cNode = jQuery('#'+nodeId);
delete sizeSyncs[nodeId];
self.height(self.height() - jQuery('#'+nodeId).outerHeight(true));
if (appendTo === 'detach') {
if (self.children().length <= 1) {
self.resizable('disable').height(0).hide();
fm.one('init', function() {
if (fm.getUI('navbar').children().not('.ui-resizable-handle').length) {
self.data('dockEnabled', true);
maxHeight: fm.getUI('workzone').height() * maxHeight,
ovf = self.css('overflow');
self.css('overflow', 'hidden');
fm.trigger('navdockresizestart', {event: e, ui: ui}, true);
resize: function(e, ui) {
fm.trigger('wzresize', { inNavdockResize : true });
fm.trigger('navdockresizestop', {event: e, ui: ui}, true);
basicHeight = ui.size.height;
fm.storage('navdockHeight', basicHeight);
resize(basicHeight, ui.originalSize.height);
self.css('overflow', ovf);
fm.bind('wzresize', function(e) {
if (self.is(':visible')) {
maxH = fm.getUI('workzone').height() * maxHeight;
if (! e.data || ! e.data.inNavdockResize) {
if (maxH < basicHeight) {
if (Math.abs(h - maxH) > 1) {
if (Math.abs(h - basicHeight) > 1) {
self.resizable('option', 'maxHeight', maxH);
}).bind('themechange', function() {
var oldH = Math.round(self.height());
requestAnimationFrame(function() {
var curH = Math.round(self.height()),
resize(self.height(), curH - diff);
fm.bind('navbarshow navbarhide', function(e) {
self[hasNode && e.type === 'navbarshow'? 'show' : 'hide']();