mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
45 lines
663 B
JavaScript
45 lines
663 B
JavaScript
$.fn.elfinder = function(o) {
|
|
|
|
if (o == 'instance') {
|
|
return this.getElFinder();
|
|
}
|
|
|
|
return this.each(function() {
|
|
|
|
var cmd = typeof(o) == 'string' ? o : '';
|
|
if (!this.elfinder) {
|
|
new elFinder(this, typeof(o) == 'object' ? o : {})
|
|
}
|
|
|
|
switch(cmd) {
|
|
case 'close':
|
|
case 'hide':
|
|
this.elfinder.hide();
|
|
break;
|
|
|
|
case 'open':
|
|
case 'show':
|
|
this.elfinder.show();
|
|
break;
|
|
|
|
case'destroy':
|
|
this.elfinder.destroy();
|
|
break;
|
|
}
|
|
|
|
})
|
|
}
|
|
|
|
$.fn.getElFinder = function() {
|
|
var instance;
|
|
|
|
this.each(function() {
|
|
if (this.elfinder) {
|
|
instance = this.elfinder;
|
|
return false;
|
|
}
|
|
});
|
|
|
|
return instance;
|
|
}
|