hedera-web/forms/admin/photos/photos.js

38 lines
699 B
JavaScript

Hedera.Photos = new Class
({
Extends: Hedera.Form
,activate: function ()
{
this.$('schema').value = 'catalog';
this.$('photo-id').focus ();
var self = this;
this.$('html-form').onsubmit = function ()
{ self._onSubmit (); return false; };
}
,_onSubmit: function ()
{
this.$('schema-field').value = this.$('schema').value;
this.$('submit').disabled = true;
this.conn.sendFormMultipart (this.$('html-form'),
this._onResponse.bind (this));
}
,_onResponse: function (json, error)
{
this.$('submit').disabled = false;
if (error)
throw error;
this.$('photo-id').value = '';
this.$('photo-id').focus ();
Htk.Toast.showMessage (_('ImageAdded'));
}
});