1.7

Table Of Contents
$element
.empty()
.append(options.clone());
$element.val($element
.find("option[selected]")
.val());
});
/** Allow Rules to be Draggable by Label */
$rule.children("label")
.attr("draggable", "true")
.addClass("draggable");
return $rule;
}
/** Manage the Available Rule Types based on Entity Type */
$("#entity")
.on("click", function (event) {
var $entity = $(event.target);
$entity.data("previous", $entity.val());
})
.on("change", function (event) {
var $entity = $(event.target),
type = $entity.val(),
options = ["property", "IN", "NOT IN",
"group"];
if (type === "DATARECORDS" || type ===
"CONTENTITEMS") {
options.unshift("value");
}
if (type === "CONTENTITEMS") {
options.push("finishing", "doclength");
}
if (type === "CONTENTITEMS" || type ===
"CONTENTSETS") {
options.push("templatename");
}
/** Set Rule Type Selector (Helper Function) */
function setRuleTypeSelector(type, options) {
var $typeSelector = $("fieldset#" + type).find
("#rule-type");
$typeSelector
Page 125