prevent user from hitting aspectmemberships controller before response on dropdowns
This commit is contained in:
parent
c67d143719
commit
7893129435
8 changed files with 12 additions and 30 deletions
|
|
@ -32,7 +32,7 @@
|
||||||
▼
|
▼
|
||||||
|
|
||||||
.wrapper
|
.wrapper
|
||||||
%ul.dropdown_list
|
%ul.dropdown_list{:unSelectable => 'on'}
|
||||||
- for aspect in @all_aspects
|
- for aspect in @all_aspects
|
||||||
%li{:data => {:aspect_id => aspect.id}}
|
%li{:data => {:aspect_id => aspect.id}}
|
||||||
= check_box_tag "yo", "hey", aspect.contacts.include?(contact)
|
= check_box_tag "yo", "hey", aspect.contacts.include?(contact)
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,6 @@ en:
|
||||||
gender: "gender"
|
gender: "gender"
|
||||||
born: "birthday"
|
born: "birthday"
|
||||||
in_aspects: "in aspects"
|
in_aspects: "in aspects"
|
||||||
cannot_remove: "Cannot remove %{name} from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
|
||||||
remove_from: "Remove %{name} from %{aspect}?"
|
remove_from: "Remove %{name} from %{aspect}?"
|
||||||
helper:
|
helper:
|
||||||
results_for: " results for %{params}"
|
results_for: " results for %{params}"
|
||||||
|
|
@ -562,7 +561,6 @@ en:
|
||||||
new: "New %{type} from %{from}"
|
new: "New %{type} from %{from}"
|
||||||
contact_list:
|
contact_list:
|
||||||
all_contacts: "All contacts"
|
all_contacts: "All contacts"
|
||||||
cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
|
||||||
stream_element:
|
stream_element:
|
||||||
like: "I like this"
|
like: "I like this"
|
||||||
dislike: "I dislike this"
|
dislike: "I dislike this"
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,6 @@ en:
|
||||||
watch: "Watch this video on {{provider}}"
|
watch: "Watch this video on {{provider}}"
|
||||||
unknown: "Unknown video type"
|
unknown: "Unknown video type"
|
||||||
search_for: "Search for {{name}}"
|
search_for: "Search for {{name}}"
|
||||||
shared:
|
|
||||||
contact_list:
|
|
||||||
cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
|
||||||
publisher:
|
publisher:
|
||||||
at_least_one_aspect: "You must publish to at least one aspect"
|
at_least_one_aspect: "You must publish to at least one aspect"
|
||||||
infinite_scroll:
|
infinite_scroll:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
};
|
};
|
||||||
var processClick = function(li, evt){
|
var processClick = function(li, evt){
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
if(li.find('.button').hasClass('disabled')){ return; }
|
||||||
|
|
||||||
var checkbox = li.find('input[type=checkbox]');
|
var checkbox = li.find('input[type=checkbox]');
|
||||||
toggleCheckbox(checkbox);
|
toggleCheckbox(checkbox);
|
||||||
|
|
|
||||||
|
|
@ -40,29 +40,15 @@ var List = {
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('.added').live('ajax:loading', function() {
|
$('.added').live('ajax:loading', function() {
|
||||||
|
$(this).addClass('disabled');
|
||||||
$(this).fadeTo(200,0.4);
|
$(this).fadeTo(200,0.4);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.add').live('ajax:loading', function() {
|
$('.add').live('ajax:loading', function() {
|
||||||
|
$(this).addClass('disabled');
|
||||||
$(this).fadeTo(200,0.4);
|
$(this).fadeTo(200,0.4);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.added').live('ajax:failure', function(data, html, xhr) {
|
|
||||||
if(confirm(Diaspora.widgets.i18n.t('shared.contact_list.cannot_remove'))){
|
|
||||||
var contact_id;
|
|
||||||
|
|
||||||
if( $('.contact_list').length == 1){
|
|
||||||
contact_id = $(this).parents('li').attr("data-contact_id");
|
|
||||||
$('.contact_list li[data-contact_id='+contact_id+']').fadeOut(200);
|
|
||||||
} else if($('#aspects_list').length == 1) {
|
|
||||||
contact_id = $(this).parents('#aspects_list').attr("data-contact_id");
|
|
||||||
};
|
|
||||||
|
|
||||||
List.disconnectUser(contact_id);
|
|
||||||
};
|
|
||||||
$(this).fadeTo(200,1);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.added').live('mouseover', function() {
|
$('.added').live('mouseover', function() {
|
||||||
$(this).addClass("remove");
|
$(this).addClass("remove");
|
||||||
$(this).children("img").attr("src","/images/icons/monotone_close_exit_delete.png");
|
$(this).children("img").attr("src","/images/icons/monotone_close_exit_delete.png");
|
||||||
|
|
|
||||||
|
|
@ -34,3 +34,8 @@
|
||||||
-khtml-opacity: $val;
|
-khtml-opacity: $val;
|
||||||
opacity: $val;
|
opacity: $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin user-select($val){
|
||||||
|
-webkit-user-select: $val;
|
||||||
|
-moz-user-select: $val;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -246,12 +246,6 @@ ul.dropdown
|
||||||
li
|
li
|
||||||
:display block
|
:display block
|
||||||
|
|
||||||
&.share.active
|
|
||||||
li:first-child
|
|
||||||
:padding-bottom 6px
|
|
||||||
|
|
||||||
:background
|
|
||||||
:color #ccc
|
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
|
|
||||||
.dropdown
|
.dropdown
|
||||||
|
|
@ -270,6 +264,7 @@ ul.dropdown
|
||||||
:border 1px solid #AAA
|
:border 1px solid #AAA
|
||||||
|
|
||||||
ul
|
ul
|
||||||
|
@include user-select(none)
|
||||||
:padding 0
|
:padding 0
|
||||||
|
|
||||||
> li
|
> li
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue