Commit f36494e5 by cahrens

Need to be able to access smoothScrollTop. This is a temporary change-- I'll…

Need to be able to access smoothScrollTop. This is a temporary change-- I'll come up with a proposal to namespace our helper functions in a nicer way.
parent 74104d60
if (!window.CmsUtils) window.CmsUtils = {};
var $body; var $body;
var $modal; var $modal;
var $modalCover; var $modalCover;
...@@ -91,7 +93,7 @@ $(document).ready(function () { ...@@ -91,7 +93,7 @@ $(document).ready(function () {
$('a[rel*="view"][href^="#"]').bind('click', smoothScrollLink); $('a[rel*="view"][href^="#"]').bind('click', smoothScrollLink);
// tender feedback window scrolling // tender feedback window scrolling
$('a.show-tender').bind('click', smoothScrollTop); $('a.show-tender').bind('click', window.CmsUtils.smoothScrollTop);
// toggling footer additional support // toggling footer additional support
$('.cta-show-sock').bind('click', toggleSock); $('.cta-show-sock').bind('click', toggleSock);
...@@ -172,7 +174,10 @@ function smoothScrollLink(e) { ...@@ -172,7 +174,10 @@ function smoothScrollLink(e) {
}); });
} }
function smoothScrollTop(e) { // On AWS instances, this base.js gets wrapped in a separate scope as part of Django static
// pipelining (note, this doesn't happen on local runtimes). So if we set it on window,
// when we can access it from other scopes (namely Course Advanced Settings).
window.CmsUtils.smoothScrollTop = function (e) {
(e).preventDefault(); (e).preventDefault();
$.smoothScroll({ $.smoothScroll({
......
...@@ -130,7 +130,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -130,7 +130,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
} }
}, },
saveView : function(event) { saveView : function(event) {
smoothScrollTop(event); window.CmsUtils.smoothScrollTop(event);
// TODO one last verification scan: // TODO one last verification scan:
// call validateKey on each to ensure proper format // call validateKey on each to ensure proper format
// check for dupes // check for dupes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment