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();
+1 -35
View File
@@ -1,37 +1,3 @@
function loadViewPage(url, id) {
var $listView = $(id);
$listView.empty().removeClass('in active');
$listView.load(url, function(response, status, xhr) {
$(this).addClass('in active');
$('#member-card').imagesLoaded(function() {
$('#member-card .member-avatar img').muImageResize({width: 150, height:150});
});
$('#member-abstract').imagesLoaded(function() {
$('#member-abstract .member-avatar img').muImageResize({width: 250, height:120});
});
})
}
$(function() {
$search = window.location.pathname.substring(1);
$search = $search.split("/");
$search = $search[$search.length-1];
$viewType = window.localStorage.getItem('viewType') || '#member-list';
$viewSwitchNo = window.localStorage.getItem('viewSwitchNo') || 0;
if($search == 'users-registrant-list.shtml') {
loadViewPage('member-registrant-list.html ' + $viewType, '#list-view');
} else {
loadViewPage('member-list.html ' + $viewType, '#list-view');
};
$('.view-switch').children('.btn').eq($viewSwitchNo).addClass('active');
$('.view-switch').delegate(".btn", 'click', function(e){
var url = $(this).attr('href'),
ID = url.split("#"),
ID = '#' + ID[ID.length-1];
window.localStorage.setItem('viewType', ID);
window.localStorage.setItem('viewSwitchNo', $(this).index());
loadViewPage(url, '#list-view');
e.preventDefault();
});
$('.member-avatar').rsImg();
})
+30 -27
View File
@@ -1,3 +1,4 @@
var H,P = [];
// Go to
!function ($) {
$.fn.goTo = function (){
@@ -13,43 +14,45 @@
}
}(window.jQuery);
function checkHeight() {
if($('#member-module').height() > $(window).height()) {
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))+
parseInt($('.wrap-inner').css('padding-bottom'))-
$('#orbit-bar').outerHeight(true);
}else{
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))+
parseInt($('.wrap-inner').css('padding-bottom'))-
$('#filter').outerHeight()+
parseInt($('#filter').css('margin-bottom'))-
$('#orbit-bar').outerHeight(true);
};
// if($('#member-module').height() > $(window).height()) {
// H = $(window).height()-
// parseInt($('.wrap-inner').css('padding-top'))+
// parseInt($('.wrap-inner').css('padding-bottom'))-
// $('#orbit-bar').outerHeight(true);
// }else{
// H = $(window).height()-
// parseInt($('.wrap-inner').css('padding-top'))+
// parseInt($('.wrap-inner').css('padding-bottom'))-
// $('#filter').outerHeight()+
// parseInt($('#filter').css('margin-bottom'))-
// $('#orbit-bar').outerHeight(true);
// };
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))-
$('#orbit-bar').outerHeight(true);
$('#basic-info').height(H);
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top')))
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top'))+20);
$('#module-content').height(H-$('#module-navbar .navbar').outerHeight(true)-$('.bottomnav').innerHeight());
};
$(function() {
var H;
checkHeight();
$(window).resize(function() {
checkHeight();
// setModuleBlockWidth();
});
$('.wrap-inner').css('padding-bottom', 0);
$(window).resize(checkHeight);
$('#member-roles h4 > span').each(function() {
$(this).css('margin-left',function() {
return $(this).innerWidth()/2*-1;
})
})
$('#basic-info').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true)+20,
});
$('#module-navbar').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true),
});
// $('#basic-info').scrollToFixed({
// marginTop: $('#orbit-bar').outerHeight(true)+20,
// });
// $('#module-navbar').scrollToFixed({
// marginTop: $('#orbit-bar').outerHeight(true),
// });
// $('.member-avatar').imagesLoaded(function() {
// $('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
// });
$('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
})
$('.member-avatar').rsImg();
$('#member-roles, #module-content .nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
});
@@ -191,12 +191,17 @@ function returnAddressForm(element, decide) {
$(function() {
appendIndex = null;
if($('#new-user-forms').length) {
if($('#user-forms').length) {
addressVal = [];
addressArray = [];
addressInputId = [];
roleType = null;
returnDecide = false;
$('.attributes').each(function() {
if($(this).find('.toggle-check').attr('value') == "true") {
$(this).addClass('disabled').children('.attributes-body').hide();
}
});
$('.returnDecide').on(clickEvent, function() {
returnDecide = true;
})
@@ -215,21 +220,21 @@ $(function() {
});
$('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true));
});
$('#new-user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
.removeClass('disabled')
.find('.attributes-body')
.children('.attributes-body')
.fadeIn(300);
} else {
$(this).find('.toggle-check')
.attr('value', 'true')
.closest('.attributes')
.addClass('disabled')
.find('.attributes-body')
.children('.attributes-body')
.fadeOut(300);
}
$(this).toggleClass('disabled');
@@ -422,12 +427,13 @@ $(function() {
if($(this).hasClass('trigger')) {
// appendIndex = $(this).closest('.controls').find('.input-append').length;
appendIndex = $(this).closest('.controls').find('.input-append:last-child').children('input:first-child').attr('name');
appendIndex = appendIndex.split("][");
appendIndex = parseInt(appendIndex[appendIndex.length-2])+1;
// appendIndex = appendIndex.split("][");
// appendIndex = parseInt(appendIndex[appendIndex.length-2])+1;
appendIndex = parseInt(appendIndex.match(/[^[\D\]]+(?=])/g)[1])+1;
console.log(appendIndex)
attributeIndex = $(this).closest('.attributes').index();
templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref');
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
inputAppendLength();
};
if($(this).hasClass('remove-input')) {