From cb9c75671a68a9a7d4ef5a91a21b4e9bd591ba57 Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Wed, 9 Dec 2020 17:54:30 +0530 Subject: [PATCH] #se-img-prop-dialog embed radio button set changes modified --- src/editor/dialogs/imagePropertiesDialog.js | 26 ++++++++++++++++++++- src/editor/svgedit.js | 5 +--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/editor/dialogs/imagePropertiesDialog.js b/src/editor/dialogs/imagePropertiesDialog.js index 042ee3b0..e8df7d10 100644 --- a/src/editor/dialogs/imagePropertiesDialog.js +++ b/src/editor/dialogs/imagePropertiesDialog.js @@ -144,7 +144,7 @@ export class SeImgPropDialog extends HTMLElement { * @returns {any} observed */ static get observedAttributes () { - return ['title', 'width', 'height', 'save', 'dialog']; + return ['title', 'width', 'height', 'save', 'dialog', 'embed']; } /** * @function attributeChangedCallback @@ -195,6 +195,16 @@ export class SeImgPropDialog extends HTMLElement { this.$imageOptRef.setAttribute('checked', false); } break; + case 'embed': + if (newValue.includes('one')) { + const data = newValue.split('|'); + if (data.length > 1) { + this._shadowRoot.querySelector('#image_opt_embed').setAttribute('title', data[1]); + this._shadowRoot.querySelector('#image_opt_embed').setAttribute('disabled', 'disabled'); + this._shadowRoot.querySelector('#image_opt_embed').style.color = '#666'; + } + } + break; default: super.attributeChangedCallback(name, oldValue, newValue); break; @@ -271,6 +281,20 @@ export class SeImgPropDialog extends HTMLElement { set dialog (value) { this.setAttribute('dialog', value); } + /** + * @function get + * @returns {any} + */ + get embed () { + return this.hasAttribute('embed'); + } + /** + * @function set + * @returns {void} + */ + set embed (value) { + this.setAttribute('embed', value); + } /** * @function connectedCallback * @returns {void} diff --git a/src/editor/svgedit.js b/src/editor/svgedit.js index 60503dfa..3cd0f917 100644 --- a/src/editor/svgedit.js +++ b/src/editor/svgedit.js @@ -4254,10 +4254,7 @@ editor.init = () => { const $imgDialog = document.getElementById('se-img-prop'); editor.pref('img_save', 'ref'); $imgDialog.setAttribute('save', 'ref'); - const $imageSaveOpts = $imgDialog.shadowRoot.querySelector('#image_save_opts'); - $imageSaveOpts.querySelector('[value=embed]').setAttribute('disabled', 'disabled'); - $imageSaveOpts.querySelector('#image_opt_embed').style.color = "#666"; - $imageSaveOpts.querySelector('#image_opt_embed').setAttribute('title', uiStrings.notification.featNotSupported); + $imgDialog.setAttribute('embed', 'one|' + uiStrings.notification.featNotSupported); } }); }, 1000);