mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added template loading through AJAX
This commit is contained in:
@ -3,6 +3,7 @@ App.Presenters = App.Presenters || {};
|
||||
|
||||
App.Presenters.RegistrationPresenter = function(
|
||||
jQuery,
|
||||
util,
|
||||
topNavigationPresenter,
|
||||
messagePresenter,
|
||||
api) {
|
||||
@ -10,7 +11,12 @@ App.Presenters.RegistrationPresenter = function(
|
||||
topNavigationPresenter.select('register');
|
||||
|
||||
var $el = jQuery('#content');
|
||||
var template = _.template(jQuery('#registration-form-template').html());
|
||||
var template;
|
||||
|
||||
util.loadTemplate('registration-form').then(function(html) {
|
||||
template = _.template(html);
|
||||
render();
|
||||
});
|
||||
|
||||
var eventHandlers = {
|
||||
|
||||
@ -50,8 +56,6 @@ App.Presenters.RegistrationPresenter = function(
|
||||
},
|
||||
};
|
||||
|
||||
render();
|
||||
|
||||
function render() {
|
||||
$el.html(template());
|
||||
$el.find('form').submit(eventHandlers.registrationFormSubmit);
|
||||
|
Reference in New Issue
Block a user