Browse Source
Merge pull request #1130 from JuanTincho/Fix-duplicate-image-edit-button Fixes #1129
Fix cloning edit image - pencil button while cloning an image
pull/1151/head
Artur Arseniev
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
16 additions and
5 deletions
-
src/dom_components/model/ComponentImage.js
|
|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|