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

+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')) {