moving attack form to modal/overlay ... initial cut

This commit is contained in:
Jason White 2016-06-29 10:39:54 +02:00
parent f203f38702
commit a8ac2d7a0c
2 changed files with 8 additions and 3 deletions

View File

@ -182,7 +182,12 @@ define(['jquery',
this.hideShowAttack = function (options) { // will likely expand this to encompass this.hideShowAttack = function (options) { // will likely expand this to encompass
if (options.show) { if (options.show) {
$('div.attack-container').show(); $('div#attack-container').show();
$('div#attack-container div.modal-header button.close, #about-modal div.modal-footer button').unbind('click').on('click', function() {
$('div#attack-container').hide(200);
});
//this.lessonView.makeFormsAjax();
//this.lessonView.ajaxifyAttackHref();
} }
}; };

View File

@ -32,14 +32,14 @@ define(['jquery',
//timeout: 3000 //timeout: 3000
}; };
//hook forms //TODO: clarify form selectors later //hook forms //TODO: clarify form selectors later
$("form.attack").ajaxForm(options); $("form.attack-form").ajaxForm(options);
}, },
ajaxifyAttackHref: function() { // rewrite any links with hrefs point to relative attack URLs ajaxifyAttackHref: function() { // rewrite any links with hrefs point to relative attack URLs
var self = this; var self = this;
// The current LessonAdapter#getLink() generates a hash-mark link. It will not match the mask below. // The current LessonAdapter#getLink() generates a hash-mark link. It will not match the mask below.
// Besides, the new MVC code registers an event handler that will reload the lesson according to the route. // Besides, the new MVC code registers an event handler that will reload the lesson according to the route.
$.each($('a[href^="attack?"]'),function(i,el) { $.each($('a[href^="attack?"]'),function(i,el) { //FIXME: need to figure out what to do here ...
var url = $(el).attr('href'); var url = $(el).attr('href');
$(el).unbind('click').attr('href','#').attr('link',url); $(el).unbind('click').attr('href','#').attr('link',url);
//TODO pull currentMenuId //TODO pull currentMenuId