Skip to content

Commit

Permalink
MINOR JS formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Feb 21, 2012
1 parent abfa16f commit 3cad19a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion admin/javascript/LeftAndMain.EditForm.js
Expand Up @@ -60,7 +60,7 @@


// Catch navigation events before they reach handleStateChange(), // Catch navigation events before they reach handleStateChange(),
// in order to avoid changing the menu state if the action is cancelled by the user // in order to avoid changing the menu state if the action is cancelled by the user
$('.cms-menu') // $('.cms-menu')


// focus input on first form element // focus input on first form element
this.find(':input:visible:not(:submit):first').focus(); this.find(':input:visible:not(:submit):first').focus();
Expand Down
8 changes: 4 additions & 4 deletions admin/javascript/LeftAndMain.Menu.js
Expand Up @@ -68,7 +68,7 @@


//show all the flyout-indicators //show all the flyout-indicators
var par = $('.cms-menu-list ul.collapsed-flyout').parent(); var par = $('.cms-menu-list ul.collapsed-flyout').parent();
if (par.children('.child-flyout-indicator').length == 0) par.append('<span class="child-flyout-indicator"></span>').fadeIn(); if (par.children('.child-flyout-indicator').length === 0) par.append('<span class="child-flyout-indicator"></span>').fadeIn();
par.children('.child-flyout-indicator').fadeIn(); par.children('.child-flyout-indicator').fadeIn();
} }
} }
Expand Down Expand Up @@ -242,12 +242,12 @@
// Only applies to edit forms relating to page elements // Only applies to edit forms relating to page elements
if(!$('.cms-content').is('.CMSMain')) return; if(!$('.cms-content').is('.CMSMain')) return;


var link = this.find('a:first'), href = link.attr("href").split('/') var link = this.find('a:first'), href = link.attr("href").split('/');
// Assumes that current ID will always be the last URL segment (and not a query parameter) // Assumes that current ID will always be the last URL segment (and not a query parameter)
href[href.length -1] = id; href[href.length -1] = id;
link.attr('href', href.join('/')); link.attr('href', href.join('/'));
} }
}) });


$('.cms-menu-list #Menu-CMSPageAddController').entwine({ $('.cms-menu-list #Menu-CMSPageAddController').entwine({
setRecordID: function(id) { setRecordID: function(id) {
Expand All @@ -264,5 +264,5 @@


// Internal Helper // Internal Helper
$.expr[':'].internal = function(obj){return obj.href.match(/^mailto\:/) || (obj.hostname == location.hostname);}; $.expr[':'].internal = function(obj){return obj.href.match(/^mailto\:/) || (obj.hostname == location.hostname);};
$.expr[':'].external = function(obj){return !$(obj).is(':internal')}; $.expr[':'].external = function(obj){return !$(obj).is(':internal');};
}(jQuery)); }(jQuery));
14 changes: 5 additions & 9 deletions admin/javascript/LeftAndMain.js
Expand Up @@ -16,7 +16,7 @@ jQuery.noConflict();
var top = ($(window).height() - spinner.height()) / 2; var top = ($(window).height() - spinner.height()) / 2;
spinner.css('top', top + offset); spinner.css('top', top + offset);
spinner.show(); spinner.show();
} };


$(window).bind('resize', positionLoadingSpinner).trigger('resize'); $(window).bind('resize', positionLoadingSpinner).trigger('resize');


Expand Down Expand Up @@ -77,7 +77,7 @@ jQuery.noConflict();
if(url) window.history.replaceState({}, '', url); if(url) window.history.replaceState({}, '', url);
} }


self.redraw() self.redraw();
}); });


// Remove loading screen // Remove loading screen
Expand Down Expand Up @@ -123,9 +123,8 @@ jQuery.noConflict();
* - {Object} data Any additional data passed through to History.pushState() * - {Object} data Any additional data passed through to History.pushState()
*/ */
loadPanel: function(url, title, data) { loadPanel: function(url, title, data) {
var data = data || {}; if(!data) data = {};
var selector = data.selector || '.cms-content' var selector = data.selector || '.cms-content', contentEl = $(selector);
var contentEl = $(selector);


// Check change tracking (can't use events as we need a way to cancel the current state change) // Check change tracking (can't use events as we need a way to cancel the current state change)
var trackedEls = contentEl.find(':data(changetracker)').add(contentEl.filter(':data(changetracker)')); var trackedEls = contentEl.find(':data(changetracker)').add(contentEl.filter(':data(changetracker)'));
Expand Down Expand Up @@ -217,7 +216,7 @@ jQuery.noConflict();
newContentEl newContentEl
.removeClass(layoutClasses.join(' ')) .removeClass(layoutClasses.join(' '))
.addClass(origLayoutClasses.join(' ')); .addClass(origLayoutClasses.join(' '));
if(origStyle) newContentEl.attr('style', origStyle) if(origStyle) newContentEl.attr('style', origStyle);
newContentEl.css('visibility', 'hidden'); newContentEl.css('visibility', 'hidden');


// Allow injection of inline styles, as they're not allowed in the document body. // Allow injection of inline styles, as they're not allowed in the document body.
Expand Down Expand Up @@ -328,9 +327,6 @@ jQuery.noConflict();


// Mark up buttonsets // Mark up buttonsets
this.find('.ss-ui-buttonset').buttonset(); this.find('.ss-ui-buttonset').buttonset();
// .children().removeClass('ui-corner-all').addClass('buttonset')
// .first().addClass('ui-corner-left').end()
// .last().addClass('ui-corner-right');;
} }
}); });


Expand Down

0 comments on commit 3cad19a

Please sign in to comment.