diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-06 18:15:24 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-06 18:15:24 +0100 |
commit | 1f4c6cd6e4b712263b40de4ce1fcebe716019b4f (patch) | |
tree | d25db580032edff61a58b3be426b4681e23addf8 /pyload/web/app/scripts/views/dashboard | |
parent | fixed jshint (diff) | |
download | pyload-1f4c6cd6e4b712263b40de4ce1fcebe716019b4f.tar.xz |
package edit dialog
Diffstat (limited to 'pyload/web/app/scripts/views/dashboard')
-rw-r--r-- | pyload/web/app/scripts/views/dashboard/editPackageView.js | 19 | ||||
-rw-r--r-- | pyload/web/app/scripts/views/dashboard/packageView.js | 12 |
2 files changed, 31 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/views/dashboard/editPackageView.js b/pyload/web/app/scripts/views/dashboard/editPackageView.js new file mode 100644 index 000000000..45b0c6ddf --- /dev/null +++ b/pyload/web/app/scripts/views/dashboard/editPackageView.js @@ -0,0 +1,19 @@ +define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'hbs!tpl/dialogs/editPackage'], + function($, _, App, modalView, template) { + 'use strict'; + + return modalView.extend({ + template: template, + onHideDestroy: true, + + confirmCallback: function() { + var self = this; + this.$el.find('.input').each(function(i, el) { + self.model.set($(el).data('attr'), $(el).val()); + }); + this.model.save(); + } + + }); + + });
\ No newline at end of file diff --git a/pyload/web/app/scripts/views/dashboard/packageView.js b/pyload/web/app/scripts/views/dashboard/packageView.js index 382615212..89972f284 100644 --- a/pyload/web/app/scripts/views/dashboard/packageView.js +++ b/pyload/web/app/scripts/views/dashboard/packageView.js @@ -15,6 +15,8 @@ define(['jquery', 'app', 'views/abstract/itemView', 'underscore', 'hbs!tpl/dashb 'click .select': 'select', 'click .icon-chevron-down': 'loadMenu', 'click .btn-delete': 'deleteItem', + 'click .btn-edit': 'edit', + 'click .btn-add': 'add', 'click .dropdown-submenu a': 'invokeAddon' }, @@ -80,6 +82,16 @@ define(['jquery', 'app', 'views/abstract/itemView', 'underscore', 'hbs!tpl/dashb App.vent.trigger('package:selection'); }, + edit: function() { + var model = this.model; + _.requireOnce(['views/dashboard/editPackageView'], function(ModalView) { + new ModalView({model: model}).show(); + }); + }, + + add: function() { + }, + loadMenu: function() { App.addons.getForType(true, null, _.bind(this.renderSubmenu, this)); }, |