diff --git a/index.html b/index.html index 3bef48e..bdc848c 100644 --- a/index.html +++ b/index.html @@ -63,11 +63,8 @@
-
- - - -
+ + Help
diff --git a/js/control/Profile.js b/js/control/Profile.js index 3b9268c..e0e7be1 100644 --- a/js/control/Profile.js +++ b/js/control/Profile.js @@ -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(); + } + }); } }); diff --git a/js/index.js b/js/index.js index 212714e..e471340 100644 --- a/js/index.js +++ b/js/index.js @@ -146,6 +146,10 @@ router.setOptions(routingOptions.getOptions()); } } + + if (evt.callback) { + evt.callback(); + } }); }); profile.on('clear', function(evt) {