Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Moved $('.cms-panel-link') and $('.cms-link-ajax') behaviours t…

…o "higher order" namespace
  • Loading branch information...
commit 9a96b92c815f560e8a77316d5fc7ab8a52e10ad5 1 parent 3b9c939
@chillu chillu authored
View
39 admin/javascript/LeftAndMain.Content.js
@@ -296,43 +296,4 @@
}
});
- /**
- * Loads the link's 'href' attribute into a panel via ajax,
- * as opposed to triggering a full page reload.
- * Little helper to avoid repetition, and make it easy to
- * "opt in" to panel loading, while by default links still exhibit their default behaviour.
- * Same goes for breadcrumbs in the CMS.
- */
- $('.cms-content .cms-panel-link, .cms-content a.crumb').entwine({
- onclick: function(e) {
- var href = this.attr('href'), url = href ? href : this.data('href'),
- data = (this.data('targetPanel')) ? {selector: this.data('targetPanel')} : null;
-
- $('.cms-container').entwine('ss').loadPanel(url, null, data);
- e.preventDefault();
- }
- });
-
- /**
- * Does an ajax loads of the link's 'href' attribute via ajax and displays any FormResponse messages from the CMS.
- * Little helper to avoid repetition, and make it easy to trigger actions via a link,
- * without reloading the page, changing the URL, or loading in any new panel content.
- */
- $('.cms-content .cms-link-ajax').entwine({
- onclick: function(e) {
- var href = this.attr('href'), url = href ? href : this.data('href');
-
- jQuery.ajax({
- url: url,
- // Ensure that form view is loaded (rather than whole "Content" template)
- complete: function(xmlhttp, status) {
- var msg = (xmlhttp.getResponseHeader('X-Status')) ? xmlhttp.getResponseHeader('X-Status') : xmlhttp.responseText;
- if (typeof msg != "undefined" && msg != null) eval(msg);
- },
- dataType: 'html'
- });
- e.preventDefault();
- }
- });
-
})(jQuery);
View
39 admin/javascript/LeftAndMain.js
@@ -278,6 +278,45 @@ jQuery.noConflict();
});
/**
+ * Loads the link's 'href' attribute into a panel via ajax,
+ * as opposed to triggering a full page reload.
+ * Little helper to avoid repetition, and make it easy to
+ * "opt in" to panel loading, while by default links still exhibit their default behaviour.
+ * Same goes for breadcrumbs in the CMS.
+ */
+ $('.cms .cms-panel-link, .cms a.crumb').entwine({
+ onclick: function(e) {
+ var href = this.attr('href'), url = href ? href : this.data('href'),
+ data = (this.data('targetPanel')) ? {selector: this.data('targetPanel')} : null;
+
+ $('.cms-container').loadPanel(url, null, data);
+ e.preventDefault();
+ }
+ });
+
+ /**
+ * Does an ajax loads of the link's 'href' attribute via ajax and displays any FormResponse messages from the CMS.
+ * Little helper to avoid repetition, and make it easy to trigger actions via a link,
+ * without reloading the page, changing the URL, or loading in any new panel content.
+ */
+ $('.cms .cms-link-ajax').entwine({
+ onclick: function(e) {
+ var href = this.attr('href'), url = href ? href : this.data('href');
+
+ jQuery.ajax({
+ url: url,
+ // Ensure that form view is loaded (rather than whole "Content" template)
+ complete: function(xmlhttp, status) {
+ var msg = (xmlhttp.getResponseHeader('X-Status')) ? xmlhttp.getResponseHeader('X-Status') : xmlhttp.responseText;
+ if (typeof msg != "undefined" && msg != null) eval(msg);
+ },
+ dataType: 'html'
+ });
+ e.preventDefault();
+ }
+ });
+
+ /**
* Trigger dialogs with iframe based on the links href attribute (see ssui-core.js).
*/
$('.cms .ss-ui-dialog-link').entwine({
Please sign in to comment.
Something went wrong with that request. Please try again.