Browse files

Small fixes

  • Loading branch information...
1 parent 0737fb8 commit de49c9e86296c6311646a7c60e1faf8acf0d2b9a Konstantin Vorobyev committed Apr 3, 2012
Showing with 39 additions and 27 deletions.
  1. +1 −1 src/sstack/datamanager.js
  2. +38 −26 src/sstack/sheet.js
View
2 src/sstack/datamanager.js
@@ -540,7 +540,7 @@ var DataManager = function(database) {//Do DB operations
var dt = new Date();
var m = text.match(this.reg);
if (!m) {
- return dt.getHours()*100;
+ return [dt.getHours()*100];
};
var regToMins = function (start) {
var hrs = 0;
View
64 src/sstack/sheet.js
@@ -43,15 +43,27 @@ var Sheet = function(sheet, element, proxy, menuPlace) {//
caption: 'Remove',
classNameInner: 'button_remove',
handler: _.bind(function() {//
- _showQuestion('Remove note?', _.bind(function (index) {
- if (0 == index) {
- this.proxy('removeNote', _.bind(function(id, err) {//Removed
- if (id) {
- this.reload();
- };
- }, this), [this.selected.id]);
- };
- }, this))
+ if (this.selected.selectedTag) {
+ _showQuestion('Remove tag?', _.bind(function (index) {
+ if (0 == index) {
+ this.proxy('removeTag', _.bind(function(id, err) {//
+ if (id) {
+ this.reload();
+ };
+ }, this), [this.selected.id, this.selected.selectedTag.id]);
+ };
+ }, this))
+ } else {
+ _showQuestion('Remove note?', _.bind(function (index) {
+ if (0 == index) {
+ this.proxy('removeNote', _.bind(function(id, err) {//Removed
+ if (id) {
+ this.reload();
+ };
+ }, this), [this.selected.id]);
+ };
+ }, this));
+ }
this.updated();
}, this)
});
@@ -69,23 +81,23 @@ var Sheet = function(sheet, element, proxy, menuPlace) {//
return true;
}, this),
});
- items.push({
- caption: 'Remove tag',
- cls: 'button_remove',
- handler: _.bind(function() {
- _showQuestion('Remove tag?', _.bind(function (index) {
- if (0 == index) {
- this.proxy('removeTag', _.bind(function(id, err) {//
- if (id) {
- this.reload();
- };
- }, this), [this.selected.id, this.selected.selectedTag.id]);
- };
- }, this))
- this.updated();
- return true;
- }, this),
- });
+ // items.push({
+ // caption: 'Remove tag',
+ // cls: 'button_remove',
+ // handler: _.bind(function() {
+ // _showQuestion('Remove tag?', _.bind(function (index) {
+ // if (0 == index) {
+ // this.proxy('removeTag', _.bind(function(id, err) {//
+ // if (id) {
+ // this.reload();
+ // };
+ // }, this), [this.selected.id, this.selected.selectedTag.id]);
+ // };
+ // }, this))
+ // this.updated();
+ // return true;
+ // }, this),
+ // });
items.push({
caption: 'Select tag',
handler: _.bind(function() {

0 comments on commit de49c9e

Please sign in to comment.