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.

This commit is contained in:
cahrens
2013-04-09 09:41:52 -04:00
parent 74104d6081
commit f36494e5dd
2 changed files with 8 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
if (!window.CmsUtils) window.CmsUtils = {};
var $body;
var $modal;
var $modalCover;
@@ -91,7 +93,7 @@ $(document).ready(function () {
$('a[rel*="view"][href^="#"]').bind('click', smoothScrollLink);
// tender feedback window scrolling
$('a.show-tender').bind('click', smoothScrollTop);
$('a.show-tender').bind('click', window.CmsUtils.smoothScrollTop);
// toggling footer additional support
$('.cta-show-sock').bind('click', toggleSock);
@@ -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();
$.smoothScroll({

View File

@@ -130,7 +130,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
}
},
saveView : function(event) {
smoothScrollTop(event);
window.CmsUtils.smoothScrollTop(event);
// TODO one last verification scan:
// call validateKey on each to ensure proper format
// check for dupes