1
|
|
2
|
|
3
|
|
4
|
(function($) {
|
5
|
Drupal.behaviors.rubik = {};
|
6
|
Drupal.behaviors.rubik.attach = function(context) {
|
7
|
|
8
|
|
9
|
$('div.form:has(div.column-main div.form-actions):not(.rubik-processed)').each(function() {
|
10
|
var form = $(this);
|
11
|
var offset = $('div.column-side div.form-actions', form).height() + $('div.column-side div.form-actions', form).offset().top;
|
12
|
$(window).scroll(function () {
|
13
|
if ($(this).scrollTop() > offset) {
|
14
|
$('div.column-main div.form-actions', form).show();
|
15
|
}
|
16
|
else {
|
17
|
$('div.column-main div.form-actions', form).hide();
|
18
|
}
|
19
|
});
|
20
|
form.addClass('rubik-processed');
|
21
|
});
|
22
|
|
23
|
$('a.toggler:not(.rubik-processed)', context).each(function() {
|
24
|
var id = $(this).attr('href').split('#')[1];
|
25
|
|
26
|
if ($('#' + id).size() > 0) {
|
27
|
$(this).click(function() {
|
28
|
toggleable = $('#' + id);
|
29
|
toggleable.toggle();
|
30
|
$(this).toggleClass('toggler-active');
|
31
|
return false;
|
32
|
});
|
33
|
}
|
34
|
|
35
|
else {
|
36
|
$(this).addClass('toggler-disabled');
|
37
|
$(this).click(function() { return false; });
|
38
|
}
|
39
|
|
40
|
$(this).addClass('rubik-processed');
|
41
|
});
|
42
|
};
|
43
|
$(document).ready(function() {
|
44
|
|
45
|
var activeli = $('.primary-tabs li.active .secondary-tabs li.active');
|
46
|
if (activeli.length == 0) {
|
47
|
$('.primary-tabs li.active .secondary-tabs li:first-child a').css('display', 'block');
|
48
|
}
|
49
|
});
|
50
|
})(jQuery);
|