|
@@ -58,6 +58,14 @@ export default class MediaFormView extends View {
|
|
|
this.keystrokes = new KeystrokeHandler();
|
|
this.keystrokes = new KeystrokeHandler();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * The value of the URL input.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @member {String} #mediaURLInputValue
|
|
|
|
|
+ * @observable
|
|
|
|
|
+ */
|
|
|
|
|
+ this.set( 'mediaURLInputValue', '' );
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* The URL input view.
|
|
* The URL input view.
|
|
|
*
|
|
*
|
|
|
* @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
|
|
* @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
|
|
@@ -71,6 +79,7 @@ export default class MediaFormView extends View {
|
|
|
*/
|
|
*/
|
|
|
this.saveButtonView = this._createButton( t( 'Save' ), checkIcon, 'ck-button-save' );
|
|
this.saveButtonView = this._createButton( t( 'Save' ), checkIcon, 'ck-button-save' );
|
|
|
this.saveButtonView.type = 'submit';
|
|
this.saveButtonView.type = 'submit';
|
|
|
|
|
+ this.saveButtonView.bind( 'isEnabled' ).to( this, 'mediaURLInputValue' );
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* The Cancel button view.
|
|
* The Cancel button view.
|
|
@@ -276,6 +285,7 @@ export default class MediaFormView extends View {
|
|
|
inputField.on( 'input', () => {
|
|
inputField.on( 'input', () => {
|
|
|
// Display the tip text only when there's some value. Otherwise fall back to the default info text.
|
|
// Display the tip text only when there's some value. Otherwise fall back to the default info text.
|
|
|
labeledInput.infoText = inputField.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault;
|
|
labeledInput.infoText = inputField.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault;
|
|
|
|
|
+ this.mediaURLInputValue = inputField.element.value.trim();
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
return labeledInput;
|
|
return labeledInput;
|