refactor hideError + rename to hide

This commit is contained in:
Norbert Renner 2015-03-26 22:58:39 +01:00
parent b7a8245af9
commit 650bacd915
3 changed files with 5 additions and 9 deletions

View file

@ -29,7 +29,7 @@ BR.Message = L.Class.extend({
} }
}, },
_hide: function (type) { hide: function () {
$('#' + this.id + ' .alert').alert('close'); $('#' + this.id + ' .alert').alert('close');
}, },
@ -37,10 +37,6 @@ BR.Message = L.Class.extend({
this._show(err, 'error'); this._show(err, 'error');
}, },
hideError: function () {
this._hide('error');
},
showWarning: function (msg) { showWarning: function (msg) {
this._show(msg, 'warning'); this._show(msg, 'warning');
} }

View file

@ -57,7 +57,7 @@ BR.Profile = L.Class.extend({
var button = evt.target || evt.srcElement, var button = evt.target || evt.srcElement,
profile = this.ele.value; profile = this.ele.value;
this.message.hideError(); this.message.hide();
$(button).button('uploading'); $(button).button('uploading');
evt.preventDefault(); evt.preventDefault();

View file

@ -145,7 +145,7 @@
elevation = new BR.Elevation(); elevation = new BR.Elevation();
profile = new BR.Profile(); profile = new BR.Profile();
profile.on('update', function(evt) { profile.on('update', function(evt) {
BR.message.hideError(); BR.message.hide();
var profileId = routingOptions.getCustomProfile(); var profileId = routingOptions.getCustomProfile();
router.uploadProfile(profileId, evt.profileText, function(err, profileId) { router.uploadProfile(profileId, evt.profileText, function(err, profileId) {
if (!err) { if (!err) {
@ -172,7 +172,7 @@
}); });
}); });
profile.on('clear', function(evt) { profile.on('clear', function(evt) {
profile.message.hideError(); profile.message.hide();
routingOptions.setCustomProfile(null); routingOptions.setCustomProfile(null);
}); });
trackMessages = new BR.TrackMessages({ trackMessages = new BR.TrackMessages({
@ -205,7 +205,7 @@
} }
return; return;
} else { } else {
BR.message.hideError(); BR.message.hide();
} }
var track = routing.toPolyline(), var track = routing.toPolyline(),