new ui member bug and interface fix

This commit is contained in:
Spen authored and saurabhbhatia committed 2013-09-02 11:22:17 +08:00
1 parent 82b6be483a
commit 3123c5de0a
26 files changed
+365 -295

No files matched your search

+16 -25
View File
@@ -38,7 +38,11 @@ if($.support.touch) {
$checked.each(function() {
if(!$(this).closest('div').hasClass('togglebox')) {
$(this).wrap('<div class="toggle-control"/>');
$(this).wrap('<div class="togglebox" />');
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
$(this).wrap('<div class="togglebox disabled" />');
} else {
$(this).wrap('<div class="togglebox" />');
}
$('<label><b></b></label>').insertAfter($(this));
if($(this).data().deploy) {
switch($(this).data().deploy) {
@@ -252,8 +256,8 @@ if($.support.touch) {
$arrow = $('.sub-nav-arrow'),
$wrap = $('#main-wrap'),
$wrapLeft = $wrap.css('margin-left'),
$position = 0,
$arrowHeightFormat = $('.position').height()-8;
$position = $arrow.outerHeight(true)*-1,
$arrowHeightFormat = $arrow.outerHeight(true)/2;
if($('#sidebar').length>0) {
$wrap.css({'margin-left': 61});
$wrapLeft = 61;
@@ -270,7 +274,7 @@ if($.support.touch) {
}
// Arrow defaults position
$position = $el.eq($elIndex).offset().top-$el.eq($elIndex).height()/2+$arrowHeightFormat-$(document).scrollTop();
$position = $el.eq($elIndex).position().top+$el.eq($elIndex).height()/2-$arrowHeightFormat+$('.scroller').position().top;
$arrow.css({
'top': $position,
});
@@ -281,7 +285,7 @@ if($.support.touch) {
$el.on(mouseenterEvent, function(e) {
$block.siblings().removeClass('show').eq($(this).index()).addClass('show');
$arrow.stop(true, false).animate({
top: ($(this).offset().top-$(this).height()/2)+$arrowHeightFormat-$(document).scrollTop(),
top: ($(this).position().top+$(this).height()/2)-$arrowHeightFormat+$('.scroller').position().top,
},{
duration: 500,
easing: 'easeInOutBack',
@@ -325,7 +329,7 @@ if($.support.touch) {
})
};
// $el.on('mouseleave', function() {
// $el.hasClass('active') ? $position = $el.eq($elIndex).offset().top-$el.eq($elIndex).height()/2+$arrowHeightFormat-$(document).scrollTop() : 0;
// $el.hasClass('active') ? $position = $el.eq($elIndex).position().top+$el.eq($elIndex).height()/2-$arrowHeightFormat+$('.scroller').position().top;
// $(this).hasClass('active') ? '':$(this).children('span').removeClass('hover');
// });
$block.on({
@@ -372,9 +376,9 @@ if($.support.touch) {
if($elIndex === null) {
$position = 0;
$position = $arrow.outerHeight(true)*-1;
} else {
$position = $el.eq($elIndex).offset().top-$el.eq($elIndex).height()/2+$arrowHeightFormat-$(document).scrollTop();
$position = $el.eq($elIndex).position().top+$el.eq($elIndex).height()/2-$arrowHeightFormat+$('.scroller').position().top;
}
$arrow.stop(true, false).animate({
top: $position,
@@ -409,8 +413,8 @@ if($.support.touch) {
});
// Sidebar Nav Drag
if(/MSIE 8.0/g.test($ua)){
$arrow.remove();
$sidebarMenu.addClass('nano')
.css({'position': 'relative', 'top': '0px'})
.children('.scroller')
.addClass('content')
.removeClass('scroller');
@@ -472,15 +476,6 @@ if($.support.touch) {
}(window.jQuery);
var ini = function() {
api = this
api.modal = function(e) {
$('#dialog a.delete-item').attr("href", e);
$('#dialog').modal('show');
}
}
// Open Slide
function openSlide() {
var $openSlide = $('.open-slide'),
@@ -506,8 +501,8 @@ function openSlide() {
}
function formTip() {
if($('.main-forms').length && $('.add-on').length) {
$('.main-forms .add-on, .main-forms .file-link').tooltip({
if($('.main-forms').length && $('.add-on').length || $('.phtot-action').length) {
$('.main-forms .add-on, .main-forms .file-link, .phtot-action li').tooltip({
position: {
my: "center bottom-4",
at: "center top"
@@ -536,10 +531,6 @@ function changeStatusHidden() {
// Document Ready
$(function() {
new ini();
$('.delete').on('click', function() {
api.modal($(this).attr('rel'));
})
initialState();
$('#login').on('shown', function () {
$(document.body).addClass('modalBlur');
@@ -565,7 +556,7 @@ $(function() {
if($('#sidebar').length) {
if(!/MSIE 8.0/g.test(navigator.userAgent)){
document.getElementById('sidebar').addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
};
}
}
if($('#pageslide').length) {
openSlide();