profile buttons: no group, blur (bootstrap sets focus?), uploading text

This commit is contained in:
Norbert Renner 2015-03-08 12:07:16 +01:00
parent 9eade5bbb6
commit ed228a96ce
3 changed files with 20 additions and 9 deletions

View file

@ -1,23 +1,33 @@
BR.Profile = L.Class.extend({
initialize: function () {
L.DomUtil.get('profile_upload').onsubmit = L.bind(this._submit, this);
L.DomUtil.get('upload').onclick = L.bind(this._upload, this);
L.DomUtil.get('clear').onclick = L.bind(this.clear, this);
},
clear: function(evt) {
var button = evt.target || evt.srcElement;
evt.preventDefault();
document.profile_upload.profile.value = null;
this.fire('clear');
button.blur();
},
_submit: function(evt) {
var form = evt.target || evt.srcElement,
_upload: function(evt) {
var button = evt.target || evt.srcElement,
profile = document.profile_upload.profile.value;
$(button).button('uploading');
evt.preventDefault();
this.fire('update', { profileText: profile });
this.fire('update', {
profileText: profile,
callback: function () {
$(button).button('reset');
$(button).blur();
}
});
}
});