|
113 | 113 | element = composer.element;
|
114 | 114 |
|
115 | 115 | if (selection.isCollapsed()) {
|
116 |
| - if (selection.caretIsInTheBeginnig('li')) { |
117 |
| - // delete in the beginnig of LI will outdent not delete |
| 116 | + if (fixDeleteInTheBeginnigOfHeading(composer)) { |
118 | 117 | event.preventDefault();
|
119 |
| - composer.commands.exec('outdentList'); |
120 |
| - } else { |
121 |
| - if (fixDeleteInTheBeginnigOfHeading(composer)) { |
122 |
| - event.preventDefault(); |
123 |
| - return; |
124 |
| - } |
125 |
| - if (fixLastBrDeletionInTable(composer)) { |
126 |
| - event.preventDefault(); |
127 |
| - return; |
128 |
| - } |
129 |
| - if (handleUneditableDeletion(composer)) { |
130 |
| - event.preventDefault(); |
131 |
| - return; |
132 |
| - } |
| 118 | + return; |
| 119 | + } |
| 120 | + if (fixLastBrDeletionInTable(composer)) { |
| 121 | + event.preventDefault(); |
| 122 | + return; |
| 123 | + } |
| 124 | + if (handleUneditableDeletion(composer)) { |
| 125 | + event.preventDefault(); |
| 126 | + return; |
133 | 127 | }
|
134 | 128 | } else {
|
135 | 129 | if (selection.containsUneditable()) {
|
|
139 | 133 | }
|
140 | 134 | };
|
141 | 135 |
|
142 |
| - var handleTabKeyDown = function(composer, element) { |
| 136 | + var handleTabKeyDown = function(composer, element, shiftKey) { |
143 | 137 | if (!composer.selection.isCollapsed()) {
|
144 | 138 | composer.selection.deleteContents();
|
145 | 139 | } else if (composer.selection.caretIsInTheBeginnig('li')) {
|
146 |
| - if (composer.commands.exec('indentList')) return; |
| 140 | + if (shiftKey) { |
| 141 | + if (composer.commands.exec('outdentList')) return; |
| 142 | + } else { |
| 143 | + if (composer.commands.exec('indentList')) return; |
| 144 | + } |
147 | 145 | }
|
148 | 146 |
|
149 | 147 | // Is   close enough to tab. Could not find enough counter arguments for now.
|
|
306 | 304 | if (this.config.handleTabKey && keyCode === wysihtml5.TAB_KEY) {
|
307 | 305 | // TAB key handling
|
308 | 306 | event.preventDefault();
|
309 |
| - handleTabKeyDown(this, this.element); |
| 307 | + handleTabKeyDown(this, this.element, event.shiftKey); |
310 | 308 | }
|
311 | 309 |
|
312 | 310 | };
|
|
0 commit comments