update acl internal list whenever there is a change - the submit handler seems to be unreliable or is getting into a race condition.
This commit is contained in:
parent
5e41ef9219
commit
d7dcf463ed
@ -20,16 +20,23 @@ function ACL(backend_url, preset){
|
|||||||
if (preset.length==0) that.showall.addClass("selected");
|
if (preset.length==0) that.showall.addClass("selected");
|
||||||
|
|
||||||
/*events*/
|
/*events*/
|
||||||
that.showall.click(that.on_showall);
|
|
||||||
$(document).on('click','.acl-button-show',that.on_button_show);
|
$(document).ready(function() {
|
||||||
$(document).on('click','.acl-button-hide',that.on_button_hide);
|
that.showall.click(that.on_showall);
|
||||||
$("#acl-search").keypress(that.on_search);
|
$(document).on('click','.acl-button-show',that.on_button_show);
|
||||||
$("#acl-wrapper").parents("form").submit(that.on_submit);
|
$(document).on('click','.acl-button-hide',that.on_button_hide);
|
||||||
|
$("#acl-search").keypress(that.on_search);
|
||||||
/* startup! */
|
// $("#acl-wrapper").parents("form").submit(that.on_submit);
|
||||||
that.get(0,100);
|
|
||||||
|
/* startup! */
|
||||||
|
that.get(0,100);
|
||||||
|
that.on_submit();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no longer called on submit - call to update whenever a change occurs to the acl list.
|
||||||
|
|
||||||
ACL.prototype.on_submit = function(){
|
ACL.prototype.on_submit = function(){
|
||||||
aclfileds = $("#acl-fields").html("");
|
aclfileds = $("#acl-fields").html("");
|
||||||
$(that.allow_gid).each(function(i,v){
|
$(that.allow_gid).each(function(i,v){
|
||||||
@ -44,6 +51,8 @@ ACL.prototype.on_submit = function(){
|
|||||||
$(that.deny_cid).each(function(i,v){
|
$(that.deny_cid).each(function(i,v){
|
||||||
aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
|
aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
|
||||||
});
|
});
|
||||||
|
// alert(aclfileds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ACL.prototype.search = function(){
|
ACL.prototype.search = function(){
|
||||||
@ -72,6 +81,7 @@ ACL.prototype.on_showall = function(event){
|
|||||||
that.deny_gid = [];
|
that.deny_gid = [];
|
||||||
|
|
||||||
that.update_view();
|
that.update_view();
|
||||||
|
that.on_submit();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -86,7 +96,7 @@ ACL.prototype.on_button_show = function(event){
|
|||||||
$(this).toggleClass("selected");*/
|
$(this).toggleClass("selected");*/
|
||||||
|
|
||||||
that.set_allow($(this).parent().attr('id'));
|
that.set_allow($(this).parent().attr('id'));
|
||||||
|
that.on_submit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ACL.prototype.on_button_hide = function(event){
|
ACL.prototype.on_button_hide = function(event){
|
||||||
@ -99,7 +109,7 @@ ACL.prototype.on_button_hide = function(event){
|
|||||||
$(this).toggleClass("selected");*/
|
$(this).toggleClass("selected");*/
|
||||||
|
|
||||||
that.set_deny($(this).parent().attr('id'));
|
that.set_deny($(this).parent().attr('id'));
|
||||||
|
that.on_submit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user