|
|
|
@ -34,12 +34,23 @@ module.exports = Component.extend( |
|
|
|
|
|
|
|
// Add Image Editor button only if the default command exists
|
|
|
|
if (cmd.has(cmdName)) { |
|
|
|
let hasButtonBool = false; |
|
|
|
var tb = this.get('toolbar'); |
|
|
|
tb.push({ |
|
|
|
attributes: { class: 'fa fa-pencil' }, |
|
|
|
command: cmdName |
|
|
|
}); |
|
|
|
this.set('toolbar', tb); |
|
|
|
|
|
|
|
for (let i = 0; i < tb.length; i++) { |
|
|
|
if (tb[i].command === 'image-editor') { |
|
|
|
hasButtonBool = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!hasButtonBool) { |
|
|
|
tb.push({ |
|
|
|
attributes: { class: 'fa fa-pencil' }, |
|
|
|
command: cmdName |
|
|
|
}); |
|
|
|
this.set('toolbar', tb); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|