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