Revert "MDL-33303 Filepicker: resized to match HTML editor and made resizable"

This reverts commit c947ea3e3f.
This commit is contained in:
Eloy Lafuente (stronk7) 2012-07-05 23:21:34 +02:00
parent 2fba8f5a92
commit ecad7393e3
3 changed files with 7 additions and 67 deletions

View file

@ -83,14 +83,6 @@ M.form_filemanager.init = function(Y, options) {
} else {
this.filecount = 0;
}
this.publish('filemanager:content-changed', {
context : this,
prefix : 'filemanager',
preventable : false,
type : 'content-changed'
});
// prepare filemanager for drag-and-drop upload
this.filemanager = Y.one('#filemanager-'+options.client_id);
if (this.filemanager.hasClass('filemanager-container') || !this.filemanager.one('.filemanager-container')) {
@ -130,44 +122,6 @@ M.form_filemanager.init = function(Y, options) {
this.filemanager.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').removeClass('checked')
this.filemanager.all('.fp-vb-icons').addClass('checked')
this.refresh(this.currentpath); // MDL-31113 get latest list from server
// Make sure that the filemanager is at least shown within the constraints of the page
if ((this.filemanager.get('offsetWidth') + this.filemanager.getX()) > this.filemanager.get('docWidth')) {
this.filemanager.setStyle('width', Math.round(this.filemanager.get('docWidth') - this.filemanager.getX()));
}
if (Y.Resize) {
// We only do this is the YUI resize component is loaded
var resize = new Y.Resize({
node: this.dndcontainer,
wrap : true,
handles : ['br']
}).plug(Y.Plugin.ResizeConstrained, {
minWidth : 410,
maxWidth : this.dndcontainer.ancestor('.ffilemanager').get('offsetWidth') || 1600,
minHeight : 160,
maxHeight : 1024
});
// When it resizes we need to correct the width and height of other elements.
resize.on('resize:resize', function(e) {
this.filemanager.setStyle('width', e.info.offsetWidth);
var fmcw = this.filemanager.one('.fp-content');
if (fmcw) {
fmcw.setStyle('height', this.dndcontainer.get('offsetHeight'));
}
}, this);
// After resizing we update the user preference so that we always show them the file manager at the same size.
resize.on('resize:end', function(e){
M.util.set_user_preference('filemanagerresizedto', Math.round(e.info.offsetWidth).toString()+','+Math.round(e.info.offsetHeight).toString());
});
// When content gets updated by the filemanager we need to auto-update the height of the resizeable area to include it.
this.on('filemanager:content-changed', function(){
var fmcw = this.filemanager.one('.fp-content');
if (fmcw) {
fmcw.setStyle('height', this.dndcontainer.get('offsetHeight'));
}
}, this);
}
},
wait: function() {
@ -557,7 +511,7 @@ M.form_filemanager.init = function(Y, options) {
filenode : element_template,
callbackcontext : this,
callback : function(e, node) {
if (e.preventDefault) {e.preventDefault();}
if (e.preventDefault) { e.preventDefault(); }
if (node.type == 'folder') {
this.refresh(node.filepath);
} else {
@ -565,7 +519,7 @@ M.form_filemanager.init = function(Y, options) {
}
},
rightclickcallback : function(e, node) {
if (e.preventDefault) {e.preventDefault();}
if (e.preventDefault) { e.preventDefault(); }
this.select_file(node);
},
classnamecallback : function(node) {
@ -652,7 +606,6 @@ M.form_filemanager.init = function(Y, options) {
node.appendChild(Y.Node.create('<option/>').
set('value', list[i]).setContent(list[i]))
}
this.fire('filemanager:content-changed');
},
update_file: function(confirmed) {
var selectnode = this.selectnode;