1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

use dropdown for publib create button

This commit is contained in:
Daniel Pan
2016-03-31 21:05:46 +08:00
parent d07e7be840
commit b9ba54f635
5 changed files with 32 additions and 33 deletions

View File

@@ -35,8 +35,14 @@ define([
toggleClass: '.js-dropdown-toggle',
popupClass: '.js-dropdown-content',
defaultOptions: {
'left': '0px'
},
initialize: function(options) {
this.$el.on('click', '.js-dropdown-toggle', _.bind(this.toggleDropdown, this));
this.options = {};
_.extend(this.options, this.defaultOptions, options);
},
hide: function() {
@@ -45,7 +51,13 @@ define([
},
show: function() {
var $menu = this.$('.js-dropdown-content');
app.ui.currentDropdown = this;
if (this.options.right) {
$menu.css('right', this.options.right);
} else {
$menu.css('left', this.options.left);
}
this.$('.js-dropdown-content').removeClass('hide');
},