jquery - button('reset') -
the next single page application (created else) authenticates users, http://backbonedevise.herokuapp.com created using backbonejs , plugin called marionette. trying rewrite without marionnette. success , error callbacks have line of code
el.find('input.btn-primary').button('reset');
prior login html looks this
<input type="submit" value="login" class="btn btn-primary">
in other words, doesn't have type reset. i'm assuming line el.find('input.btn-primary').button('reset');
somehow resets button. tried rewrite way
$('input.btn-primary').button('reset');
but received error,
object has no method button.
can explain might doing wrong , how might prepare it.
the success callback.
this.model.save(this.model.attributes, { success: function(usersession, response) { el.find('form').prepend(bd.helpers.notifications.success("instructions resetting password have been sent. please check email farther instructions.")); el.find('input.btn-primary').button('reset'); },
marionette implements .button()
method in it's internals.
it's .button()
hook manage button states, didn't dig far (i don't know marionette).
here's instance in marionette .button
defined, although there plenty of places reference found:
a.fn.button = function (c) { homecoming this.each(function () { var d = a(this), e = d.data("button"), f = typeof c == "object" && c; e || d.data("button", e = new b(this, f)), c == "toggle" ? e.toggle() : c && e.setstate(c) })
what boils downwards either need figure out .button()
in marionette , re-implement yourself, or without entirely.
for it's worth, jquery ui has .button
method, too, since you're still using jquery, plug in.
jquery
No comments:
Post a Comment