- 
                Notifications
    You must be signed in to change notification settings 
- Fork 57
EZP-30732: As an Editor I want be able to add embed/images inside table cells #1034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.5
Are you sure you want to change the base?
Changes from all commits
7a97f04
              c40b66c
              8b3687b
              9e8739d
              2a38bb2
              0a812c4
              e95e1d9
              82a77c2
              419b3fd
              6936bb5
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|  | @@ -59,7 +59,14 @@ | |||||
|  | ||||||
| if (elementPath && elementPath.block) { | ||||||
| const elements = elementPath.elements; | ||||||
| const insertIndex = !elementPath.contains(isCustomTag, true) ? elements.length - 2 : 0; | ||||||
| const insideTableCell = elementPath.blockLimit && elementPath.blockLimit.getName() === 'td'; | ||||||
| const insideCustomTag = elementPath.contains(isCustomTag, true); | ||||||
| const insideListItem = elementPath.lastElement.getName() == 'li'; | ||||||
| let insertIndex = insideTableCell || insideCustomTag || insideListItem ? 0 : elements.length - 2; | ||||||
|  | ||||||
|         
                  dew326 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||||||
| if (elementPath.lastElement.getName() == 'li') { | ||||||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here I have a question why you have to check if this is a list item and increase the index There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dew326 Answering your question: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 
        Suggested change
       
 | ||||||
| insertIndex++; | ||||||
| } | ||||||
|  | ||||||
| element.insertAfter(elements[insertIndex]); | ||||||
| } else if (editor.widgets && editor.widgets.focused) { | ||||||
|  | ||||||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -19,9 +19,9 @@ import embedBaseDefinition from '../widgets/ez-embed-base'; | |
| init: function(editor) { | ||
| editor.ezembed = { | ||
| canBeAdded: () => { | ||
| const path = editor.elementPath(); | ||
|  | ||
| return !path || path.contains('table', true) === null; | ||
| console.warn('[DEPRECATED] canBeAdded method is deprecated'); | ||
| console.warn('[DEPRECATED] it will be removed from ezplatform-admin-ui 2.0'); | ||
| return true; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is not needed anymore so we can remove it in 3.0 for BC we need to keep it in 2.5.x. console.warn('[DEPRECATED] canBeAdded method is deprecated');
console.warn('[DEPRECATED] it will be removed from ezplatform-admin-ui 2.0');The usage of this method can be safely removed from our buttons: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All requested changes are done. Also a deprecation warning for  | ||
| }, | ||
| }; | ||
|  | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.