66
66
<yd-display-card-settings v-if =" showCardSettings" :card =" cardInEdit" ></yd-display-card-settings >
67
67
<yd-display-classware-settings v-if =" showClasswareSettings" :classwareId =" rootUuid" ></yd-display-classware-settings >
68
68
<yd-edit-category-dialog v-if =" showCategorySettings" :card =" cardInEdit" :newCategory =" showNewClasswareCategorySettings" ></yd-edit-category-dialog >
69
+ <yd-edit-card-dialog v-if =" showEditResCardDialog" :cardInEdit =" cardInEdit" ></yd-edit-card-dialog >
70
+
69
71
</transition >
70
72
<div class =" dark-overlay" v-if =" isOverlay" ></div >
71
73
<!-- Multi-touch areas-->
@@ -248,6 +250,7 @@ import Utils from '../utils'
248
250
import YdDisplayClasswareSettings from ' ../components/YdDisplayClasswareSettings'
249
251
import YdDisplayCardSettings from ' ../components/YdDisplayCardSettings'
250
252
import YdEditCategoryDialog from ' ../components/YdEditCategoryDialog'
253
+ import YdEditCardDialog from ' ../components/YdEditCardDialog'
251
254
import _ from ' lodash'
252
255
253
256
export default {
@@ -261,6 +264,7 @@ export default {
261
264
cardInEdit: {},
262
265
showClasswareSettings: false ,
263
266
showNewClasswareCategorySettings: false ,
267
+ showEditResCardDialog: false ,
264
268
firstStartup: false ,
265
269
touchAreas: [
266
270
{ name: ' touch-top-left' , pressed: false },
@@ -269,7 +273,7 @@ export default {
269
273
]
270
274
}
271
275
},
272
- components: { YdDrawer, YdDisplayClasswareSettings, YdDisplayCardSettings, YdEditCategoryDialog },
276
+ components: { YdDrawer, YdDisplayClasswareSettings, YdDisplayCardSettings, YdEditCategoryDialog, YdEditCardDialog },
273
277
watch: {
274
278
editMode : function (val , oldVal ) {
275
279
window .ga .trackEvent (' USER_EVENT' , ' EDITMODE' , ' CHANGE' , val, false )
@@ -285,6 +289,9 @@ export default {
285
289
return classwareObj .name
286
290
},
287
291
showCardSettings : function () {
292
+ if (this .showEditResCardDialog ) {
293
+ return false
294
+ }
288
295
if (this .cardInEdit && this .cardInEdit .type === ' card' ) {
289
296
return true
290
297
}
@@ -364,6 +371,18 @@ export default {
364
371
// TODO: Close drawers or warn if root is not the same with top classware
365
372
this .showClasswareSettings = false
366
373
})
374
+ EventBus .$on (Events .DISPLAY_SAME_SCREEN_EDIT_RESOURCE , (doc ) => {
375
+ console .log (' from display: ' )
376
+ console .log (doc)
377
+ // this.showCardSettings = false
378
+ this .cardInEdit = doc
379
+ this .showEditResCardDialog = true
380
+ })
381
+ // for eidt resource dialog to be closed
382
+ EventBus .$on (Events .RESOURCE_NEW_CARD_CLOSE , () => {
383
+ this .showEditResCardDialog = false
384
+ this .cardInEdit = {}
385
+ })
367
386
EventBus .$on (Events .DISPLAY_NEW_ROOT_CLASSWARE , (doc ) => {
368
387
window .ga .trackEvent (' USER_EVENT' , ' DISPLAY' , ' ROOT_COURSEWARE_CHANGED' )
369
388
window .setTimeout (() => {
@@ -404,6 +423,8 @@ export default {
404
423
this .showClasswareSettings = false
405
424
} else if (this .showNewClasswareCategorySettings ) {
406
425
this .showNewClasswareCategorySettings = false
426
+ } else if (this .showEditResCardDialog ) {
427
+ this .showEditResCardDialog = false
407
428
} else if (! _ .isEmpty (this .cardInEdit )) {
408
429
this .cardInEdit = {}
409
430
} else if (this .drawers .length > 1 ) {
0 commit comments