Pageslide fix for error message and focused element

This commit is contained in:
chris 2013-10-20 20:54:23 +08:00
parent 4403ca3504
commit 606ac05563
2 changed files with 20 additions and 8 deletions

View File

@ -53,6 +53,7 @@ function customOpenSlide() {
.addClass('active'); .addClass('active');
}, },
closeFn: function(pageslide, element) { closeFn: function(pageslide, element) {
$('.item-menu').removeAttr('style');
element.removeClass('active') element.removeClass('active')
.closest('.navbar-inner') .closest('.navbar-inner')
.removeClass('active'); .removeClass('active');
@ -60,7 +61,12 @@ function customOpenSlide() {
loadComplete: function(pageslide, element) { loadComplete: function(pageslide, element) {
$openSlide.removeClass('active'); $openSlide.removeClass('active');
$('.navbar-inner').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'), var _id = element.data('id'),
_type = element.hasClass('page') ? 'page' : 'link', _type = element.hasClass('page') ? 'page' : 'link',
_edit = element.hasClass('edit') ? true : false; _edit = element.hasClass('edit') ? true : false;
@ -85,6 +91,7 @@ function customOpenSlide() {
.addClass('active'); .addClass('active');
}, },
closeFn: function(pageslide, element) { closeFn: function(pageslide, element) {
$('.item-menu').removeAttr('style');
element.removeClass('active') element.removeClass('active')
.closest('.navbar-inner') .closest('.navbar-inner')
.removeClass('active'); .removeClass('active');
@ -93,7 +100,12 @@ function customOpenSlide() {
loadComplete: function(pageslide, element) { loadComplete: function(pageslide, element) {
$openSlide.removeClass('active'); $openSlide.removeClass('active');
$('.navbar-inner').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); pageslide.find('.content').css('padding', 0);
} }
}); });
@ -153,7 +165,7 @@ function pageSetting(id, edit) {
}) })
.fail(function(jqXHR, textStatus) { .fail(function(jqXHR, textStatus) {
console.log(jqXHR.status, textStatus) console.log(jqXHR.status, textStatus)
var $errorMsg = '<div class="error"><div class="msg"><i class="icons-warning"></i><p>Sorry! Something is wrong</p></div></div>' var $errorMsg = '<div class="error-cover"><div class="msg"><i class="icons-warning"></i><p>Sorry! Something is wrong</p></div></div>'
$('#pageslide .view-page').append($errorMsg); $('#pageslide .view-page').append($errorMsg);
}); });
} else { } else {

View File

@ -88,7 +88,7 @@
#pageslide .groups { #pageslide .groups {
margin-bottom: 10px; margin-bottom: 10px;
} }
#pageslide .error { #pageslide .error-cover {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -100,19 +100,19 @@
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95); filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95);
opacity: .95; opacity: .95;
} }
#pageslide .error .msg { #pageslide .error-cover .msg {
position: absolute; position: absolute;
top: 50%; top: 50%;
margin-top: -55px; margin-top: -55px;
height: 110px; height: 110px;
width: 100%; width: 100%;
} }
#pageslide .error i { #pageslide .error-cover i {
font-size: 6em; font-size: 6em;
} }
#pageslide .error p { #pageslide .error-cover p {
font-size: 1.3em; font-size: 1.3em;
} }
#pageslide .suckIE { #pageslide .suckIE {
color: #EE4545; color: #EE4545;
} }