diff --git a/app/source/TodoEdit.js b/app/source/TodoEdit.js index 3a25ed6..fe09bde 100644 --- a/app/source/TodoEdit.js +++ b/app/source/TodoEdit.js @@ -22,9 +22,28 @@ enyo.kind({ "onSave": "" }, components: [ - + {name: "insertPopup", kind: "ModalDialog", dismissWithClick: true, + components: [ + {name: "projects", kind: "RowGroup", caption: "Projects"}, + {name: "contexts", kind: "RowGroup", caption: "Contexts"}, + {kind: "Button", caption: "Dismiss", onclick: "closePopup"} + ]}, + {name: "filterToolbar", kind: "Toolbar", pack: "justify", className: "enyo-toolbar-light", + components: [ + {kind: "RadioGroup", name: "priGroup", + onChange: "setPriority", components: [ + {caption: "-", value: "-"}, + {caption: "A", value: "A"}, + {caption: "B", value: "B"}, + {caption: "C", value: "C"}, + {caption: "D", value: "D"}, + {caption: "E", value: "E"} + ]}, + {kind: "Button", caption: "+", onclick: "showInsert"} + ] + }, {flex: 1, kind: "Scroller", components: [ - {kind: "Input", name: "tododetail"}, + {kind: "RichText", name: "tododetail", richContent: false}, ]}, {name: "editToolbar", kind: "Toolbar", pack: "justify", className: "enyo-toolbar-light", components: [ @@ -35,6 +54,63 @@ enyo.kind({ ] } - ] + ], + + setPriority: function(inSender) { + var pri = inSender.getValue(); + var val = this.$.tododetail.getValue(); + val = val.replace(/^\([A-E]\)\s/,"") + if (pri.match(/[A-E]/)) { + this.$.tododetail.setValue( + "(" + pri + ") " + val); + } else { + this.$.tododetail.setValue( val ); + } + }, + + showInsert: function() { + this.$.insertPopup.openAtCenter(); + this.projectList = this.owner.$.listView.getProjectList(); + for (i=0; i