11/* --------------------------------------------------------
22 VueJS - Task Manager
3- Version: 0.0.1
3+ Version: 0.1.0
44 Author: Steven Morrison
55 Website: www.zaffri.com
66 GitHub: github.com/Zaffri
@@ -28,38 +28,6 @@ var app = new Vue({
2828 cancelText : "Cancel" ,
2929 callbackData : { }
3030 } ,
31- /*modalConfig: {
32- // Modal visibility
33- visible: false,
34-
35- // type: notify || confirm
36- type: "confirm",
37-
38- // display data
39- title: "Delete",
40- messageBody: "Are you sure you want to delete this?",
41- confirmText: "Confirm",
42-
43- // optional - for confirm modal type
44- cancelText: "Cancel",
45- callbackData: {
46- type: null,
47- index: 0,
48- parentIndex: 0 // parentIndex for tasks (cat index)
49- },
50- confirmCallback: function(action, data) {
51-
52- // Check action & handle callback data
53- if(action) {
54- if(data.type === "task-delete")
55- this.deleteCategory(data);
56-
57- if(data.type === "category-delete")
58- this.deleteTask(data);
59- }
60- console.log("DATA: " + JSON.stringify(data));
61- }
62- },*/
6331 categories : [ ] // all app data
6432 } ,
6533 created : function ( ) {
@@ -165,21 +133,19 @@ var app = new Vue({
165133 this . modalConfig . visible = true ;
166134 } ,
167135 modalCallback : function ( action ) {
136+ // Hide modal
168137 this . modalConfig . visible = false ;
169-
170- console . log ( 'Action: ' + action ) ;
171- console . log ( 'Data: ' + JSON . stringify ( this . modalConfig . callbackData ) ) ;
172138
173139 // if action = true (confirm clicked)
174- /* if(action == true) {
175- var actionData = this.zaffriModal.action ;
140+ if ( action == true ) {
141+ var callbackData = this . modalConfig . callbackData ;
176142 // check action type
177- if(actionData .type == "category-delete") {
178- this.deleteCategory(actionData );
143+ if ( callbackData . type == "category-delete" ) {
144+ this . deleteCategory ( callbackData ) ;
179145 } else {
180- this.deleteTask(actionData );
146+ this . deleteTask ( callbackData ) ;
181147 }
182- }*/
148+ }
183149 }
184150 }
185151} ) ;
0 commit comments