Skip to content

Commit

Permalink
Fixed sticky bug with "Next" button on importer
Browse files Browse the repository at this point in the history
If you pressed the browser's Back button after importing data (to
return to the import page), the next button wouldn't have an onClick
listener present. Event delegation being used now.
  • Loading branch information
danpaulsmith committed Apr 20, 2012
1 parent 9d28d3e commit fd9e49f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 10 additions & 0 deletions module/scripts/index.js
Expand Up @@ -708,5 +708,15 @@ function log(str) {
* Call the main initialisation function once the script & page has loaded
*/
$(document).ready(function(){

LG.initialise();

/*
* Add our own handler to the "proceed" button.
*/
$("button.proceed").die("click").live("click",function(){
log("clicked me!");
LG.validateForm();
});

});
10 changes: 1 addition & 9 deletions module/scripts/index/metadata-form.js
Expand Up @@ -7,8 +7,6 @@ $(document).ready(function(){
LG.disableFeaturesForImport();
});



/*
* If the user selects "other" when choosing a data license, then half
* of the form needs to be disabled and a license notice message displayed.
Expand Down Expand Up @@ -92,11 +90,5 @@ $("button#dummy").toggle(function(){
$("div.metadata select#data-update-freq-input").val("");
});

/*
* Add our own handler to the "proceed" button.
*/
$("button.proceed").click(function(){
//log("clicked me!");
LG.validateForm();
});


1 change: 0 additions & 1 deletion module/scripts/project.js
Expand Up @@ -609,7 +609,6 @@ LG.createDialog = function(o){

if(o.ok){
if(typeof o.ok == "function"){
log("Creating ok button with custom callback");
$('<button></button>').addClass('button').html("&nbsp;&nbsp;OK&nbsp;&nbsp;").click(o.ok).appendTo(footer);
} else {
$('<button></button>').addClass('button').html("&nbsp;&nbsp;OK&nbsp;&nbsp;").click(function(){
Expand Down

0 comments on commit fd9e49f

Please sign in to comment.