From 606ac05563795dc074f0ffcb9207190a944c5042 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 20 Oct 2013 20:54:23 +0800 Subject: [PATCH] Pageslide fix for error message and focused element --- app/assets/javascripts/lib/items/items.js.erb | 18 +++++++++++++++--- app/assets/stylesheets/lib/pageslide.css | 10 +++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index 5a687a549..c687386d3 100644 --- a/app/assets/javascripts/lib/items/items.js.erb +++ b/app/assets/javascripts/lib/items/items.js.erb @@ -53,6 +53,7 @@ function customOpenSlide() { .addClass('active'); }, closeFn: function(pageslide, element) { + $('.item-menu').removeAttr('style'); element.removeClass('active') .closest('.navbar-inner') .removeClass('active'); @@ -60,7 +61,12 @@ function customOpenSlide() { loadComplete: function(pageslide, element) { $openSlide.removeClass('active'); $('.navbar-inner').removeClass('active'); - element.addClass('active').closest('.navbar-inner').addClass('active'); + $('.item-menu').removeAttr('style'); + element.addClass('active') + .closest('.item-menu') + .css('display', 'inline-block') + .closest('.navbar-inner') + .addClass('active'); var _id = element.data('id'), _type = element.hasClass('page') ? 'page' : 'link', _edit = element.hasClass('edit') ? true : false; @@ -85,6 +91,7 @@ function customOpenSlide() { .addClass('active'); }, closeFn: function(pageslide, element) { + $('.item-menu').removeAttr('style'); element.removeClass('active') .closest('.navbar-inner') .removeClass('active'); @@ -93,7 +100,12 @@ function customOpenSlide() { loadComplete: function(pageslide, element) { $openSlide.removeClass('active'); $('.navbar-inner').removeClass('active'); - element.addClass('active').closest('.navbar-inner').addClass('active'); + $('.item-menu').removeAttr('style'); + element.addClass('active') + .closest('.item-menu') + .css('display', 'inline-block') + .closest('.navbar-inner') + .addClass('active'); pageslide.find('.content').css('padding', 0); } }); @@ -153,7 +165,7 @@ function pageSetting(id, edit) { }) .fail(function(jqXHR, textStatus) { console.log(jqXHR.status, textStatus) - var $errorMsg = '

Sorry! Something is wrong

' + var $errorMsg = '

Sorry! Something is wrong

' $('#pageslide .view-page').append($errorMsg); }); } else { diff --git a/app/assets/stylesheets/lib/pageslide.css b/app/assets/stylesheets/lib/pageslide.css index 46d42716b..1cca828d6 100644 --- a/app/assets/stylesheets/lib/pageslide.css +++ b/app/assets/stylesheets/lib/pageslide.css @@ -88,7 +88,7 @@ #pageslide .groups { margin-bottom: 10px; } -#pageslide .error { +#pageslide .error-cover { position: absolute; top: 0; bottom: 0; @@ -100,19 +100,19 @@ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95); opacity: .95; } -#pageslide .error .msg { +#pageslide .error-cover .msg { position: absolute; top: 50%; margin-top: -55px; height: 110px; width: 100%; } -#pageslide .error i { +#pageslide .error-cover i { font-size: 6em; } -#pageslide .error p { +#pageslide .error-cover p { font-size: 1.3em; } #pageslide .suckIE { color: #EE4545; -} +} \ No newline at end of file