solved conflict for member_new_ui

This commit is contained in:
Spen authored and saurabhbhatia committed 2013-08-12 15:40:34 +08:00
1 parent 9c7558847a
commit 6c514770bc
92 files changed
+3204 -2102

No files matched your search

+4 -4
View File
@@ -35,7 +35,7 @@ $(function() {
checkHeight();
$(window).resize(function() {
checkHeight();
setModuleBlockWidth();
// setModuleBlockWidth();
});
$('#member-roles h4 > span').each(function() {
$(this).css('margin-left',function() {
@@ -48,8 +48,8 @@ $(function() {
$('#module-navbar').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true),
});
$('.member-avatar').imagesLoaded(function() {
$('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
});
// $('.member-avatar').imagesLoaded(function() {
// $('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
// });
$('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
})
+45 -36
View File
@@ -68,7 +68,7 @@ function temporary() {
// Determine the Append input length
function inputAppendLength() {
$('.add-target').each(function(i) {
if($(this).children('.input-append:not(:hidden)').length == 1) {
if($(this).children('.input-append:not(:hidden)').length == 1 || $(this).children('.input-append').length == 1) {
$(this).children('.input-append').each(function() {
if($(this).children('div').hasClass('tab-content')) {
var btnLength = $(this).children('.btn').length;
@@ -96,7 +96,7 @@ function inputAppendLength() {
// Role Attribute Template Data
function setData(l, type, ol) {
var fields = "role[attribute_fields]",
var fields = $('#info').length ? "info[attribute_fields]" : $('#sub_role').length ? "sub_role[attribute_fields]" : "role[attribute_fields]",
data = {
_add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"],
_calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"],
@@ -122,7 +122,7 @@ function getAddressForm(trigger, element, decide) {
addressVal.length = addressArray.length = 0;
var addressAllVal = [];
var inputNameArray = [];
trigger.parents('.input-append').find('.tab-pane').each(function() {
trigger.closest('.input-append').find('.tab-pane').each(function() {
var adderssText = $(this).children('input[type="text"]').val(),
addersshidden = '',
addressData = {},
@@ -210,7 +210,7 @@ $(function() {
$('.control-group').delegate('.btn[data-toggle="modal"]', 'click', function() {
var $trigger = $(this);
addressInputId.length = 0;
$(this).parents('.input-append').find('.tab-pane').each(function() {
$(this).closest('.input-append').find('.tab-pane').each(function() {
addressInputId.push($(this).attr('id'));
});
$('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true));
@@ -220,14 +220,14 @@ $(function() {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.parents('.attributes')
.closest('.attributes')
.removeClass('disabled')
.find('.attributes-body')
.fadeIn(300);
} else {
$(this).find('.toggle-check')
.attr('value', 'true')
.parents('.attributes')
.closest('.attributes')
.addClass('disabled')
.find('.attributes-body')
.fadeOut(300);
@@ -235,19 +235,22 @@ $(function() {
$(this).toggleClass('disabled');
};
if($(this).hasClass('remove-input')) {
$(this).parents('.input-append').fadeOut(300, function() {
$(this).closest('.input-append').fadeOut(300, function() {
$(this).remove();
inputAppendLength();
});
};
if($(this).hasClass('trigger')) {
appendIndex = $(this).parents('.controls').find('.input-append').length;
appendIndex = $(this).closest('.controls').find('.input-append').length;
nameNumber = $(this).closest('.controls').find('.input-append:eq(0)').find('input').eq(0).attr('name');
nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0];
roleType = $(this).data('roles')
if($(this).hasClass('textInput')) {
$("#template-text").tmpl().appendTo($(this).parents('.controls').find('.add-target'));
$("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('textLengInput')) {
$("#template-text-language").tmpl().appendTo($(this).parents('.controls').find('.add-target'));
$("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('address')) {
$("#template-address").tmpl().appendTo($(this).parents('.controls').find('.add-target'));
$("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
}
inputAppendLength();
};
@@ -256,7 +259,6 @@ $(function() {
inputAppendLength();
} else {
attributesArray = [];
attributesLength = $('#attributes-area .attributes').length;
attributesHeaderLength = null;
templateType = null;
attributeIndex = null;
@@ -274,9 +276,9 @@ $(function() {
$('#attributes-area').removeClass('clickHere');
};
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
attributesLength = $('#attributes-area .attributes').length;
$("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" );
$('.toggle-check').togglebox();
attributesLength = $('#attributes-area .attributes').length;
});
@@ -295,9 +297,9 @@ $(function() {
switch(e) {
case 'text':
var val = $(this).val();
if(!$(this).parents('.field-type').length) {
if(!$(this).closest('.field-type').length) {
$data = attributesArray[i][$data];
} else if(!$(this).parents('.add-target').length) {
} else if(!$(this).closest('.add-target').length) {
$data = attributesArray[i].select[$data];
} else {
appendIndex = $(this).parent('.input-append').index()
@@ -305,21 +307,21 @@ $(function() {
$data = attributesArray[i].select.option[appendIndex][optionIndex];
}
if(val != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
$(this).closest('.attributes').find('.reply').removeClass('hide');
}
break;
case 'radio':
var checked = $(this).prop("checked");
$data = attributesArray[i][$data];
if(checked != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
$(this).closest('.attributes').find('.reply').removeClass('hide');
}
break;
case 'checkbox':
var checked = $(this).prop("checked");
$data = attributesArray[i].select[$data];
if(checked != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
$(this).closest('.attributes').find('.reply').removeClass('hide');
}
break;
case 'select-one':
@@ -329,7 +331,7 @@ $(function() {
ref = $(this).attr('ref');
});
if(ref != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
$(this).closest('.attributes').find('.reply').removeClass('hide');
}
break;
};
@@ -378,7 +380,7 @@ $(function() {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.parents('.attributes')
.closest('.attributes')
.removeClass('disabled')
.find('input, select')
.removeAttr('disabled')
@@ -386,13 +388,13 @@ $(function() {
.find('.btn-group .btn')
.removeClass('disabled')
.end().find('.attribute_field_disabled').attr('value', 'false');
if($(this).parents('.attributes').find('.dataType').children("option:selected").attr('ref')) {
$(this).parents('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300);
if($(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref')) {
$(this).closest('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300);
}
} else {
$(this).find('.toggle-check')
.attr('value', 'true')
.parents('.attributes')
.closest('.attributes')
.addClass('disabled')
.find('.attributes-body input, .attributes-body select')
.attr({'disabled': 'disabled'})
@@ -407,7 +409,7 @@ $(function() {
$(this).toggleClass('disabled');
};
if($(this).hasClass('delete')) {
$(this).parents('.attributes').fadeOut(300, function() {
$(this).closest('.attributes').fadeOut(300, function() {
$('.attributes:not(:hidden)').each(function(i) {
$(this).find('.attributes-header h4 span').text(i+1);
});
@@ -418,13 +420,19 @@ $(function() {
}).find('.attribute_field_to_delete').attr('value', 'true');;
};
if($(this).hasClass('trigger')) {
appendIndex = $(this).parents('.controls').find('.input-append').length;
attributeIndex = $(this).parents('.attributes').index();
$("#template-input-append").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo($(this).parents('.controls').find('.add-target'));
// 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;
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')) {
$(this).parent('.input-append').fadeOut(300, function() {
$(this).remove()
inputAppendLength();
});
@@ -433,20 +441,21 @@ $(function() {
});
$('#attributes-area').delegate('.dataType', 'change', function() {
$(this).children("option:selected").each(function () {
var target = $(this).parents('.attributes').find('.field-type').not('.default');
attributeIndex = $(this).parents('.attributes').index();
appendIndex = $(this).parents('.attributes').find('.add-target').find('.input-append').length;
if($(this).parents('.attributes').hasClass('default')){
var i = $(this).parents('.attributes').index()
var target = $(this).closest('.attributes').find('.field-type').not('.default');
attributeIndex = $(this).closest('.attributes').index();
appendIndex = 0
// $(this).closest('.attributes').find('.add-target').find('.input-append').length;
if($(this).closest('.attributes').hasClass('default')){
var i = $(this).closest('.attributes').index()
if($(this).attr('ref') == attributesArray[i].select.name) {
$(this).parents('.attributes').find('.field-type.default').show()
$(this).closest('.attributes').find('.field-type.default').show()
target.empty().hide();
} else {
$(this).parents('.attributes').find('.field-type.default').hide()
$(this).closest('.attributes').find('.field-type.default').hide()
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
$("#template-type").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo(target);
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}
@@ -460,7 +469,7 @@ $(function() {
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
$("#template-type").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo(target);
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}