See ChangeLog.

Monotone-Parent: b31a7aa3d154368df1ba1525deed0dd5867b42f0
Monotone-Revision: 9ecab283bcceea3e4446b4445d65cffeae83252c

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2012-03-13T21:13:31
This commit is contained in:
Francis Lachapelle
2012-03-13 21:13:31 +00:00
parent c81f3b6829
commit 06c3f547e5
3 changed files with 25 additions and 7 deletions

View File

@@ -1,5 +1,8 @@
2012-03-13 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/UIxFilterEditor.js (savePreferences):
only save the filters if there's at least one rule and one action defined.
* UI/WebServerResources/ContactsUI.js (configureDraggables):
increased the delay before starting drag and drop.

View File

@@ -1,7 +1,7 @@
( /* the toolbar groups -*-cperl-*- */
( { link = "#";
label = "Save and Close";
onclick = "return savePreferences();";
onclick = "return savePreferences(event);";
image = "tb-compose-save-flat-24x24.png"; },
{ link = "#";
isSafe = NO;

View File

@@ -783,13 +783,28 @@ function onActionDeleteClick(event) {
event.stop();
}
function savePreferences() {
var inputs = $$("DIV#filterRules input");
function savePreferences(event) {
var valid = true;
inputs.each(function(input) {
if (input.hasClassName("_invalid"))
valid = false;
});
var rules = $$("DIV#filterRules DIV.rule");
if (rules.length == 0) {
onRuleAddClick(event);
valid = false;
}
var actions = $$("DIV#filterActions DIV.action");
if (actions.length == 0) {
onActionAddClick(event);
valid = false;
}
if (valid) {
var inputs = $$("DIV#filterRules input");
inputs.each(function(input) {
if (input.hasClassName("_invalid"))
valid = false;
});
}
if (valid) {
if (window.opener) {