root / htmltest / sites / all / modules / sweaver / plugins / sweaver_plugin_editor / sweaver_plugin_editor.admin.js @ dc45a079
1 |
/**
|
---|---|
2 |
* @file
|
3 |
* Administration javascript for Sweaver.
|
4 |
*/
|
5 |
|
6 |
(function ($) { |
7 |
|
8 |
/**
|
9 |
* This behavior is dependent on the tableDrag behavior, since it uses the
|
10 |
* objects initialized in that behavior to update the row.
|
11 |
*/
|
12 |
Drupal.behaviors.propertyDrag = { |
13 |
attach: function(context) { |
14 |
var table = $('table#properties'); |
15 |
var tableDrag = Drupal.tableDrag.properties;
|
16 |
|
17 |
// Add a handler so when a row is dropped and no fields are in it, the selection is changed.
|
18 |
tableDrag.onDrop = function() { |
19 |
dragObject = this;
|
20 |
if ($(dragObject.rowObject.element).prev('tr').is('.container-row')) { |
21 |
var container = $(dragObject.rowObject.element).prev('tr').attr('id'); |
22 |
var container_field = $('select.property-container-select', dragObject.rowObject.element); |
23 |
container_field.val(container); |
24 |
} |
25 |
}; |
26 |
} |
27 |
}; |
28 |
|
29 |
})(jQuery); |