@stratusjs/angular 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/editor/editor.component.js +1 -1
- package/src/editor/editor.component.js.map +1 -1
- package/src/editor/editor.component.min.js +1 -1
- package/src/editor/editor.component.ts +1 -1
- package/src/editor/link-dialog.component.html +68 -24
- package/src/editor/link-dialog.component.js +49 -24
- package/src/editor/link-dialog.component.js.map +1 -1
- package/src/editor/link-dialog.component.min.html +1 -1
- package/src/editor/link-dialog.component.min.js +1 -1
- package/src/editor/link-dialog.component.ts +73 -34
- package/src/froala/plugins/inputButton.js +52 -3
- package/src/froala/plugins/inputButton.js.map +1 -1
- package/src/froala/plugins/inputButton.min.js +1 -1
- package/src/froala/plugins/inputButton.ts +70 -9
- package/src/froala/plugins/linkManager.js +24 -15
- package/src/froala/plugins/linkManager.js.map +1 -1
- package/src/froala/plugins/linkManager.min.js +1 -1
- package/src/froala/plugins/linkManager.ts +37 -20
- package/src/tree/tree-dialog.component.js.map +1 -1
- package/src/tree/tree-dialog.component.ts +0 -5
|
@@ -5,13 +5,17 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
TriggerInterface
|
|
7
7
|
} from '@stratusjs/angular/core/trigger.interface'
|
|
8
|
+
import {
|
|
9
|
+
LooseFunction,
|
|
10
|
+
LooseObject
|
|
11
|
+
} from '@stratusjs/core/misc'
|
|
8
12
|
|
|
9
13
|
// External Dependencies
|
|
10
14
|
import _ from 'lodash'
|
|
11
15
|
|
|
12
16
|
// Universal Button
|
|
13
17
|
// TODO: Move this elsewhere, since it isn't specific to Froala
|
|
14
|
-
export class InputButtonPlugin implements TriggerInterface {
|
|
18
|
+
export class InputButtonPlugin<EventData = string|LooseObject> implements TriggerInterface {
|
|
15
19
|
// Local
|
|
16
20
|
uid: string
|
|
17
21
|
snapshot: any
|
|
@@ -21,6 +25,11 @@ export class InputButtonPlugin implements TriggerInterface {
|
|
|
21
25
|
name = 'inputButton'
|
|
22
26
|
eventName = 'input-button'
|
|
23
27
|
editor: any
|
|
28
|
+
insert: LooseFunction
|
|
29
|
+
autoRestoreSelection = false
|
|
30
|
+
autoSaveSelection = false
|
|
31
|
+
maintainSelection = false
|
|
32
|
+
maintainSnapshot = false
|
|
24
33
|
|
|
25
34
|
// The quill parameter should be a type of Quill, but that doesn't appear to have the container attribute
|
|
26
35
|
constructor(options: any) {
|
|
@@ -37,6 +46,11 @@ export class InputButtonPlugin implements TriggerInterface {
|
|
|
37
46
|
this.name = options.name || this.name
|
|
38
47
|
this.eventName = options.eventName || this.eventName
|
|
39
48
|
this.editor = options.editor || null
|
|
49
|
+
this.insert = options.insert || null
|
|
50
|
+
this.autoRestoreSelection = options.autoRestoreSelection || null
|
|
51
|
+
this.autoSaveSelection = options.autoSaveSelection || null
|
|
52
|
+
this.maintainSelection = options.maintainSelection || null
|
|
53
|
+
this.maintainSnapshot = options.maintainSnapshot || null
|
|
40
54
|
}
|
|
41
55
|
|
|
42
56
|
findUID(el: HTMLElement): string {
|
|
@@ -59,20 +73,23 @@ export class InputButtonPlugin implements TriggerInterface {
|
|
|
59
73
|
if (!instance) {
|
|
60
74
|
return
|
|
61
75
|
}
|
|
62
|
-
//
|
|
76
|
+
// Save selection before passing off event
|
|
77
|
+
if (this.autoSaveSelection) {
|
|
78
|
+
this.saveSelection()
|
|
79
|
+
}
|
|
63
80
|
// Get snapshot before passing off event
|
|
64
81
|
this.updateSnapshot()
|
|
65
82
|
instance.trigger(this.eventName, null, this)
|
|
66
83
|
}
|
|
67
84
|
|
|
68
|
-
trigger(name: string, data:
|
|
69
|
-
// This allows
|
|
85
|
+
trigger(name: string, data: EventData, callee: TriggerInterface) {
|
|
86
|
+
// This allows us to handle data on the return
|
|
70
87
|
if (this.debug) {
|
|
71
88
|
console.log(`${this.name}.trigger():`, name, data, callee)
|
|
72
89
|
}
|
|
73
90
|
// This checks the data and inserts it on the cursor
|
|
74
|
-
if (
|
|
75
|
-
console.warn(`${this.name}.trigger():`, data, 'is not
|
|
91
|
+
if (_.isEmpty(data)) {
|
|
92
|
+
console.warn(`${this.name}.trigger():`, data, 'is not valid data.')
|
|
76
93
|
return
|
|
77
94
|
}
|
|
78
95
|
if (!this.editor) {
|
|
@@ -83,17 +100,28 @@ export class InputButtonPlugin implements TriggerInterface {
|
|
|
83
100
|
console.warn(`${this.name}.trigger():`, name, 'event is not supported.')
|
|
84
101
|
return
|
|
85
102
|
}
|
|
86
|
-
//
|
|
103
|
+
// Handle the Froala Editor Insertion
|
|
87
104
|
if (!this.restoreSnapshot()) {
|
|
88
105
|
return
|
|
89
106
|
}
|
|
107
|
+
// Attempt to Restore Selection
|
|
108
|
+
if (this.autoRestoreSelection) {
|
|
109
|
+
this.restoreSelection()
|
|
110
|
+
}
|
|
90
111
|
// Insert our data into Froala on the caret
|
|
91
|
-
this.editor.html.insert(data)
|
|
112
|
+
this.insert ? this.insert(data): this.editor.html.insert(data)
|
|
92
113
|
// Update snapshot for next insert
|
|
93
114
|
this.updateSnapshot()
|
|
115
|
+
// Save new selection
|
|
116
|
+
if (this.maintainSelection) {
|
|
117
|
+
this.saveSelection()
|
|
118
|
+
}
|
|
94
119
|
}
|
|
95
120
|
|
|
96
121
|
restoreSnapshot(): boolean {
|
|
122
|
+
if (!this.maintainSnapshot) {
|
|
123
|
+
return true
|
|
124
|
+
}
|
|
97
125
|
if (!this.snapshot) {
|
|
98
126
|
console.warn(`${this.name}.restoreSnapshot(): unable to restore editor session without a snapshot.`)
|
|
99
127
|
return false
|
|
@@ -106,7 +134,40 @@ export class InputButtonPlugin implements TriggerInterface {
|
|
|
106
134
|
}
|
|
107
135
|
|
|
108
136
|
updateSnapshot() {
|
|
109
|
-
|
|
137
|
+
if (!this.maintainSnapshot) {
|
|
138
|
+
return true
|
|
139
|
+
}
|
|
110
140
|
this.snapshot = this.editor.snapshot.get()
|
|
111
141
|
}
|
|
142
|
+
|
|
143
|
+
restoreSelection(): boolean {
|
|
144
|
+
// Ensure selection exists
|
|
145
|
+
if (!this.editor.selection) {
|
|
146
|
+
console.warn(`${this.name}.restoreSelection(): unable to restore editor selection.`)
|
|
147
|
+
return false
|
|
148
|
+
}
|
|
149
|
+
// Get focus back to the editor
|
|
150
|
+
this.editor.events.focus()
|
|
151
|
+
// Restore last selection
|
|
152
|
+
this.editor.selection.restore()
|
|
153
|
+
return true
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
saveSelection(): boolean {
|
|
157
|
+
if (!this.editor.selection) {
|
|
158
|
+
console.warn(`${this.name}.saveSelection(): unable to save editor selection.`)
|
|
159
|
+
return false
|
|
160
|
+
}
|
|
161
|
+
this.editor.selection.save()
|
|
162
|
+
return true
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
clearSelection(): boolean {
|
|
166
|
+
if (!this.editor.selection) {
|
|
167
|
+
console.warn(`${this.name}.clearSelection(): unable to clear editor selection.`)
|
|
168
|
+
return false
|
|
169
|
+
}
|
|
170
|
+
this.editor.selection.clear()
|
|
171
|
+
return true
|
|
172
|
+
}
|
|
112
173
|
}
|
|
@@ -23,6 +23,11 @@ System.register(["@stratusjs/angular/froala/plugins/inputButton", "froala-editor
|
|
|
23
23
|
name: 'Link Manager',
|
|
24
24
|
eventName: 'link-library',
|
|
25
25
|
editor,
|
|
26
|
+
insert: (link) => {
|
|
27
|
+
froala_editor_1.default.PLUGINS.link(editor).insert(link.url, '', { 'aria-label': link.title });
|
|
28
|
+
},
|
|
29
|
+
autoSaveSelection: true,
|
|
30
|
+
autoRestoreSelection: true,
|
|
26
31
|
debug
|
|
27
32
|
});
|
|
28
33
|
if (debug) {
|
|
@@ -44,21 +49,20 @@ System.register(["@stratusjs/angular/froala/plugins/inputButton", "froala-editor
|
|
|
44
49
|
onClick
|
|
45
50
|
};
|
|
46
51
|
};
|
|
47
|
-
froala_editor_1.default.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}),
|
|
52
|
+
froala_editor_1.default.RegisterCommand('linkManager', {
|
|
53
|
+
title: 'Insert from Link Library',
|
|
54
|
+
undo: false,
|
|
55
|
+
focus: false,
|
|
56
|
+
modal: true,
|
|
57
|
+
callback() {
|
|
58
|
+
const debug = false;
|
|
59
|
+
if (debug) {
|
|
60
|
+
console.log('clicked:', this.linkManager);
|
|
61
|
+
}
|
|
62
|
+
this.linkManager.onClick();
|
|
63
|
+
},
|
|
64
|
+
plugin: 'linkManager',
|
|
65
|
+
}),
|
|
62
66
|
froala_editor_1.default.DefineIcon('linkManager', { NAME: 'folder', SVG_KEY: 'insertLink' }),
|
|
63
67
|
froala_editor_1.default.DefineIcon('linkManagerInsert', { NAME: 'plus', SVG_KEY: 'add' }),
|
|
64
68
|
froala_editor_1.default.DefineIcon('linkManagerDelete', { NAME: 'trash', SVG_KEY: 'remove' });
|
|
@@ -71,6 +75,11 @@ System.register(["@stratusjs/angular/froala/plugins/inputButton", "froala-editor
|
|
|
71
75
|
name: 'Link Manager',
|
|
72
76
|
eventName: 'link-library',
|
|
73
77
|
editor: this,
|
|
78
|
+
insert: (link) => {
|
|
79
|
+
froala_editor_1.default.PLUGINS.link(this).insert(link.url, '', { 'aria-label': link.title });
|
|
80
|
+
},
|
|
81
|
+
autoSaveSelection: true,
|
|
82
|
+
autoRestoreSelection: true,
|
|
74
83
|
debug
|
|
75
84
|
});
|
|
76
85
|
if (!this.el) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["linkManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["linkManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAYA,uBAAY,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAY,CAAC,QAAQ,EAAE;gBACzD,QAA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CAA+C,CAAC,CAAA;wBAC7D,OAAM;qBACT;oBACD,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;gBAChC,CAAC;gBAGD,IAAI,EAAE,IAAI;aACb,CAAC,CAAA;QACF,CAAC","file":"linkManager.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@stratusjs/angular/froala/plugins/inputButton","froala-editor"],function(n,e){"use strict";var t,i;e&&e.id;return{setters:[function(n){t=n},function(n){i=n}],execute:function(){i.default.DEFAULTS=Object.assign(i.default.DEFAULTS,{endpoint:"/Api/Content"}),i.default.PLUGINS.linkManager=function(n){let e;return{_init:function(){e=new t.InputButtonPlugin({name:"Link Manager",eventName:"link-library",editor:n,debug:false})},onClick:function(){n.el?e.onClick(n.el):console.warn("linkManager.onClick(): unable to find element")}}},i.default.
|
|
1
|
+
System.register(["@stratusjs/angular/froala/plugins/inputButton","froala-editor"],function(n,e){"use strict";var t,i;e&&e.id;return{setters:[function(n){t=n},function(n){i=n}],execute:function(){i.default.DEFAULTS=Object.assign(i.default.DEFAULTS,{endpoint:"/Api/Content"}),i.default.PLUGINS.linkManager=function(n){let e;return{_init:function(){e=new t.InputButtonPlugin({name:"Link Manager",eventName:"link-library",editor:n,insert:e=>{i.default.PLUGINS.link(n).insert(e.url,"",{"aria-label":e.title})},autoSaveSelection:!0,autoRestoreSelection:!0,debug:false})},onClick:function(){n.el?e.onClick(n.el):console.warn("linkManager.onClick(): unable to find element")}}},i.default.RegisterCommand("linkManager",{title:"Insert from Link Library",undo:!1,focus:!1,modal:!0,callback(){this.linkManager.onClick()},plugin:"linkManager"}),i.default.DefineIcon("linkManager",{NAME:"folder",SVG_KEY:"insertLink"}),i.default.DefineIcon("linkManagerInsert",{NAME:"plus",SVG_KEY:"add"}),i.default.DefineIcon("linkManagerDelete",{NAME:"trash",SVG_KEY:"remove"}),i.default.RegisterQuickInsertButton("link",{icon:"linkManager",title:"Insert from Link Library",callback:function(){const n=new t.InputButtonPlugin({name:"Link Manager",eventName:"link-library",editor:this,insert:n=>{i.default.PLUGINS.link(this).insert(n.url,"",{"aria-label":n.title})},autoSaveSelection:!0,autoRestoreSelection:!0,debug:!1});this.el?n.onClick(this.el):console.warn("linkManager.onClick(): unable to find element")},undo:!0})}}});
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
InputButtonPlugin
|
|
4
4
|
} from '@stratusjs/angular/froala/plugins/inputButton'
|
|
5
|
+
import {
|
|
6
|
+
Link
|
|
7
|
+
} from '@stratusjs/angular/editor/link-dialog.component'
|
|
5
8
|
|
|
6
9
|
// @ts-ignore
|
|
7
10
|
import FroalaEditor from 'froala-editor'
|
|
@@ -21,10 +24,15 @@ FroalaEditor.PLUGINS.linkManager = function linkManager (editor: any) {
|
|
|
21
24
|
|
|
22
25
|
// When the plugin is initialized,this will be called.
|
|
23
26
|
function _init() {
|
|
24
|
-
inputButton = new InputButtonPlugin({
|
|
27
|
+
inputButton = new InputButtonPlugin<Link>({
|
|
25
28
|
name: 'Link Manager',
|
|
26
29
|
eventName: 'link-library',
|
|
27
30
|
editor,
|
|
31
|
+
insert: (link: Link) => {
|
|
32
|
+
FroalaEditor.PLUGINS.link(editor).insert(link.url, '', {'aria-label': link.title})
|
|
33
|
+
},
|
|
34
|
+
autoSaveSelection: true,
|
|
35
|
+
autoRestoreSelection: true,
|
|
28
36
|
debug
|
|
29
37
|
})
|
|
30
38
|
|
|
@@ -61,24 +69,28 @@ FroalaEditor.PLUGINS.linkManager = function linkManager (editor: any) {
|
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
// Insert Plugin to Image Insert
|
|
64
|
-
FroalaEditor.DEFAULTS.imageInsertButtons.push('linkManager')
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
// FroalaEditor.DEFAULTS.imageInsertButtons.push('linkManager')
|
|
73
|
+
FroalaEditor.RegisterCommand('linkManager', {
|
|
74
|
+
title: 'Insert from Link Library',
|
|
75
|
+
undo: false,
|
|
76
|
+
focus: false,
|
|
77
|
+
modal: true,
|
|
78
|
+
callback() {
|
|
79
|
+
// debug info (move variable elsewhere)
|
|
80
|
+
const debug = false
|
|
81
|
+
if (debug) {
|
|
82
|
+
console.log('clicked:', this.linkManager)
|
|
83
|
+
}
|
|
84
|
+
// testing selection saving at earlier point to avoid loss of data
|
|
85
|
+
// this.selection.save()
|
|
86
|
+
// initiate click
|
|
87
|
+
this.linkManager.onClick()
|
|
88
|
+
},
|
|
89
|
+
plugin: 'linkManager',
|
|
90
|
+
}),
|
|
91
|
+
FroalaEditor.DefineIcon('linkManager', {NAME: 'folder', SVG_KEY: 'insertLink'}),
|
|
92
|
+
FroalaEditor.DefineIcon('linkManagerInsert', {NAME: 'plus', SVG_KEY: 'add'}),
|
|
93
|
+
FroalaEditor.DefineIcon('linkManagerDelete', {NAME: 'trash', SVG_KEY: 'remove'})
|
|
82
94
|
|
|
83
95
|
// Define a quick insert button
|
|
84
96
|
FroalaEditor.RegisterQuickInsertButton('link', {
|
|
@@ -91,11 +103,16 @@ FroalaEditor.RegisterQuickInsertButton('link', {
|
|
|
91
103
|
// Callback for the button.
|
|
92
104
|
callback: function linkManagerCallback () {
|
|
93
105
|
const debug = false
|
|
94
|
-
const inputButton = new InputButtonPlugin({
|
|
106
|
+
const inputButton = new InputButtonPlugin<Link>({
|
|
95
107
|
name: 'Link Manager',
|
|
96
108
|
eventName: 'link-library',
|
|
97
109
|
// Contextual `this` is equivalent to the editor instance
|
|
98
110
|
editor: this,
|
|
111
|
+
insert: (link: Link) => {
|
|
112
|
+
FroalaEditor.PLUGINS.link(this).insert(link.url, '', {'aria-label': link.title})
|
|
113
|
+
},
|
|
114
|
+
autoSaveSelection: true,
|
|
115
|
+
autoRestoreSelection: true,
|
|
99
116
|
debug
|
|
100
117
|
})
|
|
101
118
|
if (!this.el) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tree-dialog.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuFM,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,aAAa,CAAA;YAC1B,gBAAgB,GAAG,MAAM,CAAA;YAGzB,GAAG,GAAG,CAAC,oBAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YAClC,QAAQ,GAAG,GAAG,iBAAO,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAA;YAU3F,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,0CAAmB;
|
|
1
|
+
{"version":3,"sources":["tree-dialog.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuFM,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,aAAa,CAAA;YAC1B,gBAAgB,GAAG,MAAM,CAAA;YAGzB,GAAG,GAAG,CAAC,oBAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YAClC,QAAQ,GAAG,GAAG,iBAAO,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAA;YAU3F,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,0CAAmB;gBA2CxD,YACW,SAA4C,EACnB,IAAgB,EACxC,EAAe,EAEb,GA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I,gBAAgB,IAAI,UAAU,aAAa,GAAG,OAAO;iBAEpF,CAAC;gBA8CO,WAAA,aAAM,CAAC,wBAAe,CAAC,CAAA;iDADN,qBAAY,UAElB,mBAAW;oBAER,wBAAiB;eAhD3B,mBAAmB,CAqS/B;;QACD,CAAC","file":"tree-dialog.component.js"}
|
|
@@ -131,8 +131,6 @@ export class TreeDialogComponent extends ResponsiveComponent implements OnInit,
|
|
|
131
131
|
// AutoComplete Data
|
|
132
132
|
filteredContent: Array<ContentEntity>
|
|
133
133
|
dialogContentForm: FormGroup
|
|
134
|
-
|
|
135
|
-
// maybe make all of these public...
|
|
136
134
|
isContentLoading = false
|
|
137
135
|
isContentLoaded = false
|
|
138
136
|
lastContentSelectorQuery: string
|
|
@@ -212,7 +210,6 @@ export class TreeDialogComponent extends ResponsiveComponent implements OnInit,
|
|
|
212
210
|
if (_.isString(value)) {
|
|
213
211
|
this.lastContentSelectorQuery = `${this.basicContentSelectorQuery}${value}`
|
|
214
212
|
} else {
|
|
215
|
-
// console.log('switchMap value is not a string:', value)
|
|
216
213
|
this.data.content = value
|
|
217
214
|
this.data.url = null
|
|
218
215
|
}
|
|
@@ -328,7 +325,6 @@ export class TreeDialogComponent extends ResponsiveComponent implements OnInit,
|
|
|
328
325
|
// }
|
|
329
326
|
|
|
330
327
|
private handleContent(response:HttpResponse<Convoy<ContentEntity>>) {
|
|
331
|
-
// console.log('response handled!')
|
|
332
328
|
if (!response.ok || response.status !== 200 || _.isEmpty(response.body)) {
|
|
333
329
|
this.filteredContent = []
|
|
334
330
|
// FIXME: We have to go in this roundabout way to force changes to be detected since the
|
|
@@ -371,7 +367,6 @@ export class TreeDialogComponent extends ResponsiveComponent implements OnInit,
|
|
|
371
367
|
}
|
|
372
368
|
|
|
373
369
|
public isSelected(content: ContentEntity) {
|
|
374
|
-
// console.log('isSelected:', content)
|
|
375
370
|
if (!this.data.content) {
|
|
376
371
|
return false
|
|
377
372
|
}
|