File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -217,9 +217,21 @@ class PluginMoveTree {
217217 return ;
218218 }
219219
220- // check if item with same ID already exists FIXME this also needs to check the type!
221- if ( this . itemTree ( src ) . querySelector ( `li[data-id="${ newID } "]` ) ) {
220+ // check if item with same ID and type already exists
221+ let dupSelector = `li[data-id="${ newID } "]` ;
222+ if ( this . isItemMedia ( src ) ) {
223+ dupSelector += '.move-media' ;
224+ } else {
225+ dupSelector += '.move-pages' ;
226+ }
227+ if ( this . isItemNamespace ( src ) ) {
228+ dupSelector += '.move-ns' ;
229+ } else {
230+ dupSelector += ':not(.move-ns)' ;
231+ }
232+ if ( this . itemTree ( src ) . querySelector ( dupSelector ) ) {
222233 alert ( LANG . plugins . move . duplicate . replace ( '%s' , newID ) ) ;
234+ src . classList . remove ( 'selected' ) ;
223235 return ;
224236 }
225237
You can’t perform that action at this time.
0 commit comments