diff --git a/admin/css/screen.css b/admin/css/screen.css index ef80f42cd..070205aa3 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -159,7 +159,7 @@ form.nostyle .middleColumn { margin-left: 0; } input, textarea { -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; -ms-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #ebeff1), color-stop(50%, #ffffff), color-stop(100%, #ebeff1)); background-image: -moz-linear-gradient(top, #ebeff1 0%, #ffffff 50%, #ebeff1 100%); background-image: linear-gradient(top, #ebeff1 0%, #ffffff 50%, #ebeff1 100%); border: 1px solid #aaaaaa; padding: 3px; } -input.loading { padding-left: 16px; background: #ebeff1 url(../../images/network-save.gif) no-repeat center left; } +input.loading, input.ui-state-default.loading, .ui-widget-content input.ui-state-default.loading, .ui-widget-header input.ui-state-default.loading { padding-left: 16px; background: #ebeff1 url(../../images/network-save.gif) no-repeat center left; } .ss-ui-button.ss-ui-action-constructive, .ui-widget-content .ss-ui-button.ss-ui-action-constructive, .ui-widget-header .ss-ui-button.ss-ui-action-constructive { background: none; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #77b53f), color-stop(100%, #456925)); background-image: -moz-linear-gradient(top, #77b53f 0%, #456925 100%); background-image: linear-gradient(top, #77b53f 0%, #456925 100%); color: white; } @@ -261,3 +261,5 @@ form.member-profile-form .formattingHelpText li { font-size: 11px; color: #333; .cms-preview { background-color: #b0bfc6; } .cms-preview .cms-preview-toggle { cursor: pointer; } .cms-preview .cms-preview-toggle a { color: white; font-weight: bold; text-decoration: none; } + +.cms-switch-view a { padding-right: 1em; } diff --git a/admin/javascript/LeftAndMain.Preview.js b/admin/javascript/LeftAndMain.Preview.js index d238a6d4e..a6ab43c28 100644 --- a/admin/javascript/LeftAndMain.Preview.js +++ b/admin/javascript/LeftAndMain.Preview.js @@ -2,6 +2,8 @@ $.entwine('ss', function($){ $('.LeftAndMain .cms-preview').entwine({ + SharedWidth: null, + onmatch: function() { var self = this, layoutContainer = this.parent(); // this.resizable({ @@ -11,6 +13,9 @@ // } // }); + // TODO Compute dynamically + this.setSharedWidth(500); + // Create layout and controls this.prepend('
<
'); this.find('iframe').addClass('center'); @@ -50,14 +55,13 @@ if(id && form.find(':input[name=ID]').val() != id) form.loadForm('admin/page/edit/show/' + id); }, - toggle: function() { + toggle: function(bool) { var self = this, width = this.width(), relayout = function() {$('.cms-container').layout({resize: false});}, minWidth = this.find('.cms-preview-toggle').width(), - wasCollapsed = (width <= minWidth), - sharedWidth = $('.cms-content').width() / 2, // half of content area by default - newWidth = wasCollapsed ? sharedWidth : minWidth, + wasCollapsed = (bool === true || bool === false) ? bool : (width <= minWidth), + newWidth = wasCollapsed ? this.getSharedWidth() : minWidth, newOverflow = wasCollapsed ? 'auto' : 'hidden'; this.css('overflow', newOverflow).width(newWidth); @@ -98,5 +102,14 @@ this.parents('.cms-preview').toggle(); } }); + + $('.LeftAndMain .cms-switch-view a').entwine({ + onclick: function(e) { + e.preventDefault(); + var preview = $('.cms-preview'); + preview.toggle(true); + preview.loadUrl($(e.target).attr('href')); + } + }); }); }(jQuery)); \ No newline at end of file diff --git a/admin/scss/_style.scss b/admin/scss/_style.scss index 4491f734c..4170d8a75 100644 --- a/admin/scss/_style.scss +++ b/admin/scss/_style.scss @@ -341,4 +341,10 @@ form.member-profile-form { text-decoration: none; } } +} + +.cms-switch-view { + a { + padding-right: 1em; + } } \ No newline at end of file diff --git a/admin/templates/LeftAndMain.ss b/admin/templates/LeftAndMain.ss index 1fe5b11fb..165b9938a 100644 --- a/admin/templates/LeftAndMain.ss +++ b/admin/templates/LeftAndMain.ss @@ -27,7 +27,7 @@ <% if currentPage %>
- +
<% end_if %>