@@ -41,61 +41,56 @@ class Menus {
41
41
if ( highlightedElementTag ) {
42
42
$ ( ".edit-dropdown-menu" ) . addClass ( "invisible" ) ;
43
43
$ ( ".text-dropdown-menu" ) . addClass ( "invisible" ) ;
44
- $ ( ".lists -dropdown-menu" ) . addClass ( "invisible" ) ;
44
+ $ ( ".list -dropdown-menu" ) . addClass ( "invisible" ) ;
45
45
$ ( ".selection-dropdown-menu" ) . removeClass ( "invisible" ) ;
46
46
} else {
47
47
$ ( ".edit-dropdown-menu" ) . removeClass ( "invisible" ) ;
48
48
$ ( ".text-dropdown-menu" ) . removeClass ( "invisible" ) ;
49
- $ ( ".lists -dropdown-menu" ) . removeClass ( "invisible" ) ;
49
+ $ ( ".list -dropdown-menu" ) . removeClass ( "invisible" ) ;
50
50
$ ( ".selection-dropdown-menu" ) . addClass ( "invisible" ) ;
51
51
}
52
-
53
- if ( Edit . isCaretInsideTags ( [ "ol" , "ul" ] ) ) {
54
- $ ( ".list-only-dropdown-item" ) . removeClass ( "d-none" ) ;
55
- $ ( ".list-only-menu-item" ) . removeClass ( "d-none" ) ;
56
- } else {
57
- $ ( ".list-only-dropdown-item" ) . addClass ( "d-none" ) ;
58
- $ ( ".list-only-menu-item" ) . addClass ( "d-none" ) ;
59
- }
60
-
61
52
if ( ( Edit . isCaretInsideTags ( [ "ol" , "ul" ] ) ) || ( highlightedElementTag ) ) {
62
53
$ ( ".paragraph-dropdown-menu" ) . addClass ( "invisible" ) ;
63
- $ ( ".table-insert-dropdown-item" ) . addClass ( "d-none" ) ;
64
54
} else {
65
- $ ( ".table-insert-dropdown-item" ) . removeClass ( "d-none" ) ;
66
55
$ ( ".paragraph-dropdown-menu" ) . removeClass ( "invisible" ) ;
67
56
}
57
+ if ( ( Edit . isCaretInsideTags ( [ "ol" , "ul" ] ) ) && ( ( Edit . isCaretInsideTag ( "table" ) == false ) ) ) {
58
+ $ ( ".table-dropdown-menu" ) . addClass ( "invisible" ) ;
59
+ } else {
60
+ $ ( ".table-dropdown-menu" ) . removeClass ( "invisible" ) ;
61
+ }
68
62
69
- if ( Edit . isCaretInsideTags ( [ "table" , "ol" , "ul" ] ) ) {
63
+ if ( ( Edit . isCaretInsideTags ( [ "table" , "ol" , "ul" ] ) ) || ( highlightedElementTag ) ) {
70
64
$ ( ".table-insert-dropdown-item" ) . addClass ( "d-none" ) ;
71
65
} else {
72
66
$ ( ".table-insert-dropdown-item" ) . removeClass ( "d-none" ) ;
73
67
}
74
-
75
68
if ( Edit . isCaretInsideTag ( "table" ) ) {
76
69
$ ( ".table-select-dropdown-item" ) . removeClass ( "d-none" ) ;
77
70
} else {
78
71
$ ( ".table-select-dropdown-item" ) . addClass ( "d-none" ) ;
79
72
}
80
73
74
+ if ( Edit . isCaretInsideTags ( [ "ol" , "ul" ] ) ) {
75
+ $ ( ".list-only-dropdown-item" ) . removeClass ( "d-none" ) ;
76
+ } else {
77
+ $ ( ".list-only-dropdown-item" ) . addClass ( "d-none" ) ;
78
+ }
81
79
if ( highlightedElementTag == 'table' ) {
82
80
$ ( ".table-only-dropdown-item" ) . removeClass ( "d-none" ) ;
83
81
} else {
84
82
$ ( ".table-only-dropdown-item" ) . addClass ( "d-none" ) ;
85
83
}
86
-
87
84
if ( highlightedElementTag == 'col' ) {
88
85
$ ( ".column-only-dropdown-item" ) . removeClass ( "d-none" ) ;
89
86
} else {
90
87
$ ( ".column-only-dropdown-item" ) . addClass ( "d-none" ) ;
91
88
}
92
-
93
89
if ( highlightedElementTag == 'tr' ) {
94
90
$ ( ".row-only-dropdown-item" ) . removeClass ( "d-none" ) ;
95
91
} else {
96
92
$ ( ".row-only-dropdown-item" ) . addClass ( "d-none" ) ;
97
93
}
98
-
99
94
if ( highlightedElementTag == 'td' ) {
100
95
$ ( ".cell-only-dropdown-item" ) . removeClass ( "d-none" ) ;
101
96
} else {
@@ -195,7 +190,6 @@ class Menus {
195
190
$ ( '#mutableModal' ) . modal ( "show" ) ;
196
191
Edit . selectRange ( selection ) ;
197
192
}
198
-
199
193
static modalButtonNoDismiss ( text , onclick ) {
200
194
let button = document . createElement ( "button" ) ;
201
195
button . className = "btn btn-primary btn-sm" ;
@@ -208,16 +202,15 @@ class Menus {
208
202
button . setAttribute ( "data-dismiss" , "modal" ) ;
209
203
return button ;
210
204
}
211
-
212
205
static modalNumericSelect ( labelText , id , min , max , step , selected , units ) {
213
206
let div = document . createElement ( "div" ) ;
214
207
div . className = "row" ;
215
208
let label = document . createElement ( "label" ) ;
216
- label . className = "col-sm- 8" ;
209
+ label . className = "col-8" ;
217
210
label . innerHTML = labelText ;
218
211
div . appendChild ( label ) ;
219
212
let select = document . createElement ( "select" ) ;
220
- select . className = "col-sm- 4 custom-select" ;
213
+ select . className = "col-4 custom-select" ;
221
214
select . id = id ;
222
215
div . appendChild ( select ) ;
223
216
for ( let value = min ; value <= max ; value = value + step ) {
@@ -260,7 +253,7 @@ class Menus {
260
253
let chosenStyleRow = styleTable . insertRow ( - 1 ) ;
261
254
let chosenStyleCell = chosenStyleRow . insertCell ( - 1 ) ;
262
255
chosenStyleCell . setAttribute ( "Id" , "chosenStyleCell" ) ;
263
- chosenStyleCell . className = "chosen- style" ;
256
+ chosenStyleCell . className = "style-chosen " ;
264
257
document . getElementById ( 'mutableModalBody' ) . innerHTML = styleTable . outerHTML ;
265
258
266
259
document . getElementById ( 'mutableModalFooter' ) . innerHTML = "" ;
@@ -390,7 +383,7 @@ class Menus {
390
383
let chosenStyleRow = colorTable . insertRow ( - 1 ) ;
391
384
let chosenColorCell = chosenStyleRow . insertCell ( - 1 ) ;
392
385
chosenColorCell . setAttribute ( "Id" , "chosenColorCell" ) ;
393
- chosenColorCell . className = "chosen- color" ;
386
+ chosenColorCell . className = "color-chosen " ;
394
387
document . getElementById ( 'mutableModalBody' ) . innerHTML = colorTable . outerHTML ;
395
388
396
389
document . getElementById ( 'mutableModalFooter' ) . innerHTML = "" ;
@@ -448,27 +441,29 @@ class Menus {
448
441
document . getElementById ( 'mutableModalTitle' ) . innerHTML = "Find & Replace" ;
449
442
document . getElementById ( 'mutableModalBody' ) . innerHTML =
450
443
`<div>
451
- <div class="row mb-1 mr-1">
452
- <label class="col-sm-4">Find</label>
453
- <input type="text" id="target" class="col-sm-8 pl-1"></input>
444
+ <div class="row m-1">
445
+ <span class="col-12 text-primary text-center">Find</span>
454
446
</div>
455
- <div class="row mb-1 mr-1">
456
- <label class="col-sm-4";>Replace</label>
457
- <input type="text" id="replacement" class="col-sm-8 pl-1"></input>
447
+ <div class="row m-1">
448
+ <input type="text" id="target" class="col-12"></input>
458
449
</div>
459
- <div class="row mr-1">
460
- <label class="col-sm-4"></label>
461
- <input type="checkbox" id="matchCase" class="col-sm-1"></input>
462
- <label class="col-sm-7">Match Case</label>
450
+ <div class="row m-1">
451
+ <span class="col-12 text-primary text-center">Replace</span>
452
+ </div>
453
+ <div class="row m-1">
454
+ <input type="text" id="replacement" class="col-12"></input>
455
+ </div>
456
+ <div class="row mt-2 mr-1 mb-1 ml-1">
457
+ <input type="checkbox" id="matchCase" class="col-1"></input>
458
+ <span class="col-7 text-primary text-center">Match Case</span>
463
459
</div>
464
460
</div>` ;
465
-
466
461
document . getElementById ( 'mutableModalFooter' ) . innerHTML = "" ;
467
462
document . getElementById ( 'mutableModalFooter' ) . appendChild ( Menus . modalButtonNoDismiss ( "Find" , "FindReplace.initializeFindReplace()" ) ) ;
468
463
Menus . mutableModalShow ( ) ;
469
464
}
470
465
471
- static showMessageLinkModal ( title , link ) {
466
+ static showMessageInLinkModal ( title , link ) {
472
467
document . getElementById ( 'mutableModalTitle' ) . innerHTML = title ;
473
468
document . getElementById ( 'mutableModalBody' ) . innerHTML = "<embed type='text/html' src='" + link + "'>" ;
474
469
document . getElementById ( 'mutableModalFooter' ) . innerHTML = "" ;
0 commit comments