mirror of https://github.com/keeweb/keeweb.git
drag to trash
This commit is contained in:
parent
b5aebd7917
commit
30618cf88e
2
TODO.md
2
TODO.md
|
@ -7,7 +7,7 @@ Nov
|
|||
- [ ] minimize to tray
|
||||
- [ ] trim history by rules
|
||||
- [ ] custom icons, favicons
|
||||
- [ ] drag to trash
|
||||
- [x] drag to trash
|
||||
- [ ] switch view
|
||||
- [ ] option to check updates without install
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ var MenuModel = Backbone.Model.extend({
|
|||
this.tagsSection = new MenuSectionModel(defTags);
|
||||
this.tagsSection.set({ scrollable: true, drag: true });
|
||||
this.tagsSection.defaultItems = defTags;
|
||||
this.trashSection = new MenuSectionModel([{ title: 'Trash', icon: 'trash', shortcut: Keys.DOM_VK_D, filterKey: 'trash', filterValue: true }]);
|
||||
this.trashSection = new MenuSectionModel([{ title: 'Trash', icon: 'trash', shortcut: Keys.DOM_VK_D,
|
||||
filterKey: 'trash', filterValue: true, drop: true }]);
|
||||
Colors.AllColors.forEach(function(color) { this.colorsSection.get('items').models[0]
|
||||
.addOption({ cls: 'fa ' + color + '-color', value: color, filterValue: color }); }, this);
|
||||
this.menus.app = new MenuSectionCollection([
|
||||
|
|
|
@ -200,7 +200,12 @@ var MenuItemView = Backbone.View.extend({
|
|||
e.stopPropagation();
|
||||
if (this.model.get('drop') && this.dropAllowed(e)) {
|
||||
this.$el.removeClass('menu__item--drag');
|
||||
this.model.moveHere(DragDropInfo.dragObject);
|
||||
if (this.model.get('filterKey') === 'trash') {
|
||||
DragDropInfo.dragObject.moveToTrash();
|
||||
Backbone.trigger('refresh');
|
||||
} else {
|
||||
this.model.moveHere(DragDropInfo.dragObject);
|
||||
}
|
||||
Backbone.trigger('refresh');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue