#se-img-prop-dialog embed radio button set changes modified

This commit is contained in:
Agriya Dev5
2020-12-09 17:54:30 +05:30
parent dbe84d8dc7
commit cb9c75671a
2 changed files with 26 additions and 5 deletions

View File

@@ -144,7 +144,7 @@ export class SeImgPropDialog extends HTMLElement {
* @returns {any} observed * @returns {any} observed
*/ */
static get observedAttributes () { static get observedAttributes () {
return ['title', 'width', 'height', 'save', 'dialog']; return ['title', 'width', 'height', 'save', 'dialog', 'embed'];
} }
/** /**
* @function attributeChangedCallback * @function attributeChangedCallback
@@ -195,6 +195,16 @@ export class SeImgPropDialog extends HTMLElement {
this.$imageOptRef.setAttribute('checked', false); this.$imageOptRef.setAttribute('checked', false);
} }
break; 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: default:
super.attributeChangedCallback(name, oldValue, newValue); super.attributeChangedCallback(name, oldValue, newValue);
break; break;
@@ -271,6 +281,20 @@ export class SeImgPropDialog extends HTMLElement {
set dialog (value) { set dialog (value) {
this.setAttribute('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 * @function connectedCallback
* @returns {void} * @returns {void}

View File

@@ -4254,10 +4254,7 @@ editor.init = () => {
const $imgDialog = document.getElementById('se-img-prop'); const $imgDialog = document.getElementById('se-img-prop');
editor.pref('img_save', 'ref'); editor.pref('img_save', 'ref');
$imgDialog.setAttribute('save', 'ref'); $imgDialog.setAttribute('save', 'ref');
const $imageSaveOpts = $imgDialog.shadowRoot.querySelector('#image_save_opts'); $imgDialog.setAttribute('embed', 'one|' + uiStrings.notification.featNotSupported);
$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);
} }
}); });
}, 1000); }, 1000);