2014-05-03 17:33:57 +02:00
|
|
|
(function($) {
|
|
|
|
$.entwine('colymba', function($) {
|
2014-05-01 23:03:43 +02:00
|
|
|
|
2014-05-04 13:34:31 +02:00
|
|
|
/**
|
|
|
|
* Toggle all accordion forms
|
|
|
|
* open or closed
|
|
|
|
*/
|
2014-05-03 17:33:57 +02:00
|
|
|
$('#bulkEditToggle') .entwine({
|
|
|
|
onmatch: function(){},
|
|
|
|
onunmatch: function(){},
|
|
|
|
onclick: function(e)
|
|
|
|
{
|
2014-09-07 19:18:32 +02:00
|
|
|
var toggleFields = this.parents('form').find('.ss-toggle .ui-accordion-header'),
|
2014-05-04 13:34:31 +02:00
|
|
|
state = this.data('state')
|
2014-05-03 17:33:57 +02:00
|
|
|
;
|
2014-05-01 23:03:43 +02:00
|
|
|
|
2014-05-03 17:33:57 +02:00
|
|
|
if ( !state || state === 'close' )
|
|
|
|
{
|
|
|
|
state = 'open';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
state = 'close';
|
|
|
|
}
|
2014-05-01 23:03:43 +02:00
|
|
|
|
2014-05-03 17:33:57 +02:00
|
|
|
toggleFields.each(function()
|
|
|
|
{
|
|
|
|
var $this = $(this);
|
|
|
|
|
|
|
|
if ( state === 'open' && !$this.hasClass('ui-state-active') )
|
|
|
|
{
|
|
|
|
$this.click();
|
|
|
|
}
|
2014-05-01 23:03:43 +02:00
|
|
|
|
2014-05-03 17:33:57 +02:00
|
|
|
if ( state === 'close' && $this.hasClass('ui-state-active') )
|
|
|
|
{
|
|
|
|
$this.click();
|
|
|
|
}
|
|
|
|
});
|
2014-05-01 23:03:43 +02:00
|
|
|
|
2014-05-03 17:33:57 +02:00
|
|
|
this.data('state', state);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2014-05-04 13:34:31 +02:00
|
|
|
/**
|
|
|
|
* Contains each rocrds editing fields,
|
|
|
|
* tracks changes and updates...
|
|
|
|
*/
|
2014-05-03 17:33:57 +02:00
|
|
|
$('.bulkEditingFieldHolder').entwine({
|
2014-05-04 13:34:31 +02:00
|
|
|
onmatch: function(){},
|
|
|
|
onunmatch: function(){},
|
2014-05-03 17:33:57 +02:00
|
|
|
onchange: function(){
|
|
|
|
this.removeClass('updated');
|
|
|
|
if ( !this.hasClass('hasUpdate') )
|
|
|
|
{
|
|
|
|
this.addClass('hasUpdate');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2013-12-05 16:48:01 +01:00
|
|
|
}(jQuery));
|