File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,14 @@ export default class Data {
33 this . editor = editor ;
44 window . editor = editor ;
55 this . element = editor . dom . getParent ( editor . selection . getStart ( ) , 'a[href]' ) ;
6- const textarea = document . createElement ( 'textarea' ) ;
7- textarea . innerHTML = this . editor . selection . getContent ( ) ;
8-
6+ let blocks = this . editor . selection . getSelectedBlocks ( ) ;
7+ if ( blocks [ 0 ] . firstElementChild && blocks [ 0 ] . firstElementChild . nodeName === 'A' ) {
8+ console . info ( 'Descending into anchor' ) ;
9+ this . element = blocks [ 0 ] . firstElementChild ;
10+ this . editor . selection . select ( this . element ) ;
11+ }
12+
13+
914 this . initialData = {
1015 link_text : this . editor . selection . getContent ( ) ,
1116 link_title : '' ,
Original file line number Diff line number Diff line change @@ -290,22 +290,16 @@ export default (editor, url) => {
290290 win . showTab ( currentTab ) ;
291291
292292 document . querySelectorAll ( '.tox-dialog' ) . forEach ( ( item ) => {
293- item . classList . add ( 'mce-fred- -modxlink' ) ;
293+ item . classList . add ( 'mce--modxlink' ) ;
294294 } ) ;
295295
296296
297297 const populateOptions = options => {
298- const toRemove = [ ] ;
299- console . log ( templateInputChoices ) ;
300- /* templateInputChoices.currentState.items.forEach(item => {
301- if (item.active) {
302- toRemove.push(item.value);
303- }
304- });*/
298+ const toRemove = templateInputChoices . getValue ( ) ;
305299
306300 const toKeep = [ ] ;
307301 options . forEach ( option => {
308- if ( toRemove . indexOf ( option . id ) === - 1 ) {
302+ if ( toRemove . value !== option . value ) {
309303 toKeep . push ( option ) ;
310304 }
311305 } ) ;
You can’t perform that action at this time.
0 commit comments