Skip to content

Commit

Permalink
Merge pull request #6 from rvdb/aspace-v4.0.0
Browse files Browse the repository at this point in the history
reformulated deprecated jQuery calls
  • Loading branch information
jambun authored Nov 28, 2024
2 parents 50b2680 + 6b2ce1a commit e38f4c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/assets/user_defined_in_basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ UserDefinedInBasic.prototype.init = function(fields, read_only_view, hide_user_d
var user_defined_section = $('section.subrecord-form[data-object-name="user_defined"]');
var remove_btn = user_defined_section.find('.subrecord-form-remove');
if (remove_btn.length == 0) {
user_defined_section.find('.btn-default').filter(':visible').click();
user_defined_section.find('.btn-default').filter(':visible').trigger('click');
window.scrollTo(0,0);
}

Expand Down
6 changes: 4 additions & 2 deletions frontend/views/layout_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ end
}

// For Resource record updates
$(document).bind("loadedrecordform.aspace", init);
$(document).on("loadedrecordform.aspace", init);

// For everything else
// had to bind this call to window load because a bare call to init()
// was causing Firefox to jump the gun ... javascript, sheesh
$(window).load(init);
$(window).on('load', function(){
init
})

</script>

Expand Down

0 comments on commit e38f4c8

Please sign in to comment.