Révision 219d19c4
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/ctools/js/dependent.js | ||
---|---|---|
39 | 39 |
|
40 | 40 |
Drupal.CTools.dependent.autoAttach = function() { |
41 | 41 |
// Clear active bindings and triggers. |
42 |
for (i in Drupal.CTools.dependent.activeTriggers) { |
|
42 |
for (var i in Drupal.CTools.dependent.activeTriggers) {
|
|
43 | 43 |
$(Drupal.CTools.dependent.activeTriggers[i]).unbind('change.ctools-dependent'); |
44 | 44 |
} |
45 | 45 |
Drupal.CTools.dependent.activeTriggers = []; |
... | ... | |
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
// Iterate through all relationships |
54 |
for (id in Drupal.settings.CTools.dependent) { |
|
54 |
for (var id in Drupal.settings.CTools.dependent) {
|
|
55 | 55 |
// Test to make sure the id even exists; this helps clean up multiple |
56 | 56 |
// AJAX calls with multiple forms. |
57 | 57 |
|
... | ... | |
59 | 59 |
// whether the binding is active or not. Defaults to no. |
60 | 60 |
Drupal.CTools.dependent.activeBindings[id] = 0; |
61 | 61 |
// Iterate through all possible values |
62 |
for(bind_id in Drupal.settings.CTools.dependent[id].values) {
|
|
62 |
for (var bind_id in Drupal.settings.CTools.dependent[id].values) {
|
|
63 | 63 |
// This creates a backward relationship. The bind_id is the ID |
64 | 64 |
// of the element which needs to change in order for the id to hide or become shown. |
65 | 65 |
// The id is the ID of the item which will be conditionally hidden or shown. |
... | ... | |
87 | 87 |
} |
88 | 88 |
|
89 | 89 |
var getValue = function(item, trigger) { |
90 |
if ($(trigger).size() == 0) {
|
|
90 |
if ($(trigger).length == 0) {
|
|
91 | 91 |
return null; |
92 | 92 |
} |
93 | 93 |
|
... | ... | |
129 | 129 |
return; |
130 | 130 |
} |
131 | 131 |
|
132 |
for (i in Drupal.CTools.dependent.bindings[bind_id]) { |
|
132 |
for (var i in Drupal.CTools.dependent.bindings[bind_id]) {
|
|
133 | 133 |
var id = Drupal.CTools.dependent.bindings[bind_id][i]; |
134 | 134 |
// Fix numerous errors |
135 | 135 |
if (typeof id != 'string') { |
... | ... | |
150 | 150 |
} |
151 | 151 |
|
152 | 152 |
var len = 0; |
153 |
for (i in Drupal.CTools.dependent.activeBindings[id]) { |
|
153 |
for (var i in Drupal.CTools.dependent.activeBindings[id]) {
|
|
154 | 154 |
len++; |
155 | 155 |
} |
156 | 156 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules