##// END OF EJS Templates
Merged r15301 (#22296)....
Jean-Philippe Lang -
r14920:e18eb311f55d
parent child
Show More
@@ -1,679 +1,680
1 1 /* Redmine - project management software
2 2 Copyright (C) 2006-2016 Jean-Philippe Lang */
3 3
4 4 function checkAll(id, checked) {
5 5 $('#'+id).find('input[type=checkbox]:enabled').prop('checked', checked);
6 6 }
7 7
8 8 function toggleCheckboxesBySelector(selector) {
9 9 var all_checked = true;
10 10 $(selector).each(function(index) {
11 11 if (!$(this).is(':checked')) { all_checked = false; }
12 12 });
13 13 $(selector).prop('checked', !all_checked);
14 14 }
15 15
16 16 function showAndScrollTo(id, focus) {
17 17 $('#'+id).show();
18 18 if (focus !== null) {
19 19 $('#'+focus).focus();
20 20 }
21 21 $('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
22 22 }
23 23
24 24 function toggleRowGroup(el) {
25 25 var tr = $(el).parents('tr').first();
26 26 var n = tr.next();
27 27 tr.toggleClass('open');
28 28 while (n.length && !n.hasClass('group')) {
29 29 n.toggle();
30 30 n = n.next('tr');
31 31 }
32 32 }
33 33
34 34 function collapseAllRowGroups(el) {
35 35 var tbody = $(el).parents('tbody').first();
36 36 tbody.children('tr').each(function(index) {
37 37 if ($(this).hasClass('group')) {
38 38 $(this).removeClass('open');
39 39 } else {
40 40 $(this).hide();
41 41 }
42 42 });
43 43 }
44 44
45 45 function expandAllRowGroups(el) {
46 46 var tbody = $(el).parents('tbody').first();
47 47 tbody.children('tr').each(function(index) {
48 48 if ($(this).hasClass('group')) {
49 49 $(this).addClass('open');
50 50 } else {
51 51 $(this).show();
52 52 }
53 53 });
54 54 }
55 55
56 56 function toggleAllRowGroups(el) {
57 57 var tr = $(el).parents('tr').first();
58 58 if (tr.hasClass('open')) {
59 59 collapseAllRowGroups(el);
60 60 } else {
61 61 expandAllRowGroups(el);
62 62 }
63 63 }
64 64
65 65 function toggleFieldset(el) {
66 66 var fieldset = $(el).parents('fieldset').first();
67 67 fieldset.toggleClass('collapsed');
68 68 fieldset.children('div').toggle();
69 69 }
70 70
71 71 function hideFieldset(el) {
72 72 var fieldset = $(el).parents('fieldset').first();
73 73 fieldset.toggleClass('collapsed');
74 74 fieldset.children('div').hide();
75 75 }
76 76
77 77 // columns selection
78 78 function moveOptions(theSelFrom, theSelTo) {
79 79 $(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
80 80 }
81 81
82 82 function moveOptionUp(theSel) {
83 83 $(theSel).find('option:selected').each(function(){
84 84 $(this).prev(':not(:selected)').detach().insertAfter($(this));
85 85 });
86 86 }
87 87
88 88 function moveOptionTop(theSel) {
89 89 $(theSel).find('option:selected').detach().prependTo($(theSel));
90 90 }
91 91
92 92 function moveOptionDown(theSel) {
93 93 $($(theSel).find('option:selected').get().reverse()).each(function(){
94 94 $(this).next(':not(:selected)').detach().insertBefore($(this));
95 95 });
96 96 }
97 97
98 98 function moveOptionBottom(theSel) {
99 99 $(theSel).find('option:selected').detach().appendTo($(theSel));
100 100 }
101 101
102 102 function initFilters() {
103 103 $('#add_filter_select').change(function() {
104 104 addFilter($(this).val(), '', []);
105 105 });
106 106 $('#filters-table td.field input[type=checkbox]').each(function() {
107 107 toggleFilter($(this).val());
108 108 });
109 109 $('#filters-table').on('click', 'td.field input[type=checkbox]', function() {
110 110 toggleFilter($(this).val());
111 111 });
112 112 $('#filters-table').on('click', '.toggle-multiselect', function() {
113 113 toggleMultiSelect($(this).siblings('select'));
114 114 });
115 115 $('#filters-table').on('keypress', 'input[type=text]', function(e) {
116 116 if (e.keyCode == 13) $(this).closest('form').submit();
117 117 });
118 118 }
119 119
120 120 function addFilter(field, operator, values) {
121 121 var fieldId = field.replace('.', '_');
122 122 var tr = $('#tr_'+fieldId);
123 123 if (tr.length > 0) {
124 124 tr.show();
125 125 } else {
126 126 buildFilterRow(field, operator, values);
127 127 }
128 128 $('#cb_'+fieldId).prop('checked', true);
129 129 toggleFilter(field);
130 130 $('#add_filter_select').val('').find('option').each(function() {
131 131 if ($(this).attr('value') == field) {
132 132 $(this).attr('disabled', true);
133 133 }
134 134 });
135 135 }
136 136
137 137 function buildFilterRow(field, operator, values) {
138 138 var fieldId = field.replace('.', '_');
139 139 var filterTable = $("#filters-table");
140 140 var filterOptions = availableFilters[field];
141 141 if (!filterOptions) return;
142 142 var operators = operatorByType[filterOptions['type']];
143 143 var filterValues = filterOptions['values'];
144 144 var i, select;
145 145
146 146 var tr = $('<tr class="filter">').attr('id', 'tr_'+fieldId).html(
147 147 '<td class="field"><input checked="checked" id="cb_'+fieldId+'" name="f[]" value="'+field+'" type="checkbox"><label for="cb_'+fieldId+'"> '+filterOptions['name']+'</label></td>' +
148 148 '<td class="operator"><select id="operators_'+fieldId+'" name="op['+field+']"></td>' +
149 149 '<td class="values"></td>'
150 150 );
151 151 filterTable.append(tr);
152 152
153 153 select = tr.find('td.operator select');
154 154 for (i = 0; i < operators.length; i++) {
155 155 var option = $('<option>').val(operators[i]).text(operatorLabels[operators[i]]);
156 156 if (operators[i] == operator) { option.attr('selected', true); }
157 157 select.append(option);
158 158 }
159 159 select.change(function(){ toggleOperator(field); });
160 160
161 161 switch (filterOptions['type']) {
162 162 case "list":
163 163 case "list_optional":
164 164 case "list_status":
165 165 case "list_subprojects":
166 166 tr.find('td.values').append(
167 167 '<span style="display:none;"><select class="value" id="values_'+fieldId+'_1" name="v['+field+'][]"></select>' +
168 168 ' <span class="toggle-multiselect">&nbsp;</span></span>'
169 169 );
170 170 select = tr.find('td.values select');
171 171 if (values.length > 1) { select.attr('multiple', true); }
172 172 for (i = 0; i < filterValues.length; i++) {
173 173 var filterValue = filterValues[i];
174 174 var option = $('<option>');
175 175 if ($.isArray(filterValue)) {
176 176 option.val(filterValue[1]).text(filterValue[0]);
177 177 if ($.inArray(filterValue[1], values) > -1) {option.attr('selected', true);}
178 178 } else {
179 179 option.val(filterValue).text(filterValue);
180 180 if ($.inArray(filterValue, values) > -1) {option.attr('selected', true);}
181 181 }
182 182 select.append(option);
183 183 }
184 184 break;
185 185 case "date":
186 186 case "date_past":
187 187 tr.find('td.values').append(
188 188 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="10" class="value date_value" /></span>' +
189 189 ' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="10" class="value date_value" /></span>' +
190 190 ' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="3" class="value" /> '+labelDayPlural+'</span>'
191 191 );
192 192 $('#values_'+fieldId+'_1').val(values[0]).datepicker(datepickerOptions);
193 193 $('#values_'+fieldId+'_2').val(values[1]).datepicker(datepickerOptions);
194 194 $('#values_'+fieldId).val(values[0]);
195 195 break;
196 196 case "string":
197 197 case "text":
198 198 tr.find('td.values').append(
199 199 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="30" class="value" /></span>'
200 200 );
201 201 $('#values_'+fieldId).val(values[0]);
202 202 break;
203 203 case "relation":
204 204 tr.find('td.values').append(
205 205 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="6" class="value" /></span>' +
206 206 '<span style="display:none;"><select class="value" name="v['+field+'][]" id="values_'+fieldId+'_1"></select></span>'
207 207 );
208 208 $('#values_'+fieldId).val(values[0]);
209 209 select = tr.find('td.values select');
210 210 for (i = 0; i < allProjects.length; i++) {
211 211 var filterValue = allProjects[i];
212 212 var option = $('<option>');
213 213 option.val(filterValue[1]).text(filterValue[0]);
214 214 if (values[0] == filterValue[1]) { option.attr('selected', true); }
215 215 select.append(option);
216 216 }
217 217 break;
218 218 case "integer":
219 219 case "float":
220 220 case "tree":
221 221 tr.find('td.values').append(
222 222 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="6" class="value" /></span>' +
223 223 ' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="6" class="value" /></span>'
224 224 );
225 225 $('#values_'+fieldId+'_1').val(values[0]);
226 226 $('#values_'+fieldId+'_2').val(values[1]);
227 227 break;
228 228 }
229 229 }
230 230
231 231 function toggleFilter(field) {
232 232 var fieldId = field.replace('.', '_');
233 233 if ($('#cb_' + fieldId).is(':checked')) {
234 234 $("#operators_" + fieldId).show().removeAttr('disabled');
235 235 toggleOperator(field);
236 236 } else {
237 237 $("#operators_" + fieldId).hide().attr('disabled', true);
238 238 enableValues(field, []);
239 239 }
240 240 }
241 241
242 242 function enableValues(field, indexes) {
243 243 var fieldId = field.replace('.', '_');
244 244 $('#tr_'+fieldId+' td.values .value').each(function(index) {
245 245 if ($.inArray(index, indexes) >= 0) {
246 246 $(this).removeAttr('disabled');
247 247 $(this).parents('span').first().show();
248 248 } else {
249 249 $(this).val('');
250 250 $(this).attr('disabled', true);
251 251 $(this).parents('span').first().hide();
252 252 }
253 253
254 254 if ($(this).hasClass('group')) {
255 255 $(this).addClass('open');
256 256 } else {
257 257 $(this).show();
258 258 }
259 259 });
260 260 }
261 261
262 262 function toggleOperator(field) {
263 263 var fieldId = field.replace('.', '_');
264 264 var operator = $("#operators_" + fieldId);
265 265 switch (operator.val()) {
266 266 case "!*":
267 267 case "*":
268 268 case "t":
269 269 case "ld":
270 270 case "w":
271 271 case "lw":
272 272 case "l2w":
273 273 case "m":
274 274 case "lm":
275 275 case "y":
276 276 case "o":
277 277 case "c":
278 278 case "*o":
279 279 case "!o":
280 280 enableValues(field, []);
281 281 break;
282 282 case "><":
283 283 enableValues(field, [0,1]);
284 284 break;
285 285 case "<t+":
286 286 case ">t+":
287 287 case "><t+":
288 288 case "t+":
289 289 case ">t-":
290 290 case "<t-":
291 291 case "><t-":
292 292 case "t-":
293 293 enableValues(field, [2]);
294 294 break;
295 295 case "=p":
296 296 case "=!p":
297 297 case "!p":
298 298 enableValues(field, [1]);
299 299 break;
300 300 default:
301 301 enableValues(field, [0]);
302 302 break;
303 303 }
304 304 }
305 305
306 306 function toggleMultiSelect(el) {
307 307 if (el.attr('multiple')) {
308 308 el.removeAttr('multiple');
309 309 el.attr('size', 1);
310 310 } else {
311 311 el.attr('multiple', true);
312 312 if (el.children().length > 10)
313 313 el.attr('size', 10);
314 314 else
315 315 el.attr('size', 4);
316 316 }
317 317 }
318 318
319 319 function showTab(name, url) {
320 320 $('#tab-content-' + name).parent().find('.tab-content').hide();
321 321 $('#tab-content-' + name).parent().find('div.tabs a').removeClass('selected');
322 322 $('#tab-content-' + name).show();
323 323 $('#tab-' + name).addClass('selected');
324 324 //replaces current URL with the "href" attribute of the current link
325 325 //(only triggered if supported by browser)
326 326 if ("replaceState" in window.history) {
327 327 window.history.replaceState(null, document.title, url);
328 328 }
329 329 return false;
330 330 }
331 331
332 332 function moveTabRight(el) {
333 333 var lis = $(el).parents('div.tabs').first().find('ul').children();
334 334 var tabsWidth = 0;
335 335 var i = 0;
336 336 lis.each(function() {
337 337 if ($(this).is(':visible')) {
338 338 tabsWidth += $(this).width() + 6;
339 339 }
340 340 });
341 341 if (tabsWidth < $(el).parents('div.tabs').first().width() - 60) { return; }
342 342 while (i<lis.length && !lis.eq(i).is(':visible')) { i++; }
343 343 lis.eq(i).hide();
344 344 }
345 345
346 346 function moveTabLeft(el) {
347 347 var lis = $(el).parents('div.tabs').first().find('ul').children();
348 348 var i = 0;
349 349 while (i < lis.length && !lis.eq(i).is(':visible')) { i++; }
350 350 if (i > 0) {
351 351 lis.eq(i-1).show();
352 352 }
353 353 }
354 354
355 355 function displayTabsButtons() {
356 356 var lis;
357 357 var tabsWidth;
358 358 var el;
359 359 $('div.tabs').each(function() {
360 360 el = $(this);
361 361 lis = el.find('ul').children();
362 362 tabsWidth = 0;
363 363 lis.each(function(){
364 364 if ($(this).is(':visible')) {
365 365 tabsWidth += $(this).width() + 6;
366 366 }
367 367 });
368 368 if ((tabsWidth < el.width() - 60) && (lis.first().is(':visible'))) {
369 369 el.find('div.tabs-buttons').hide();
370 370 } else {
371 371 el.find('div.tabs-buttons').show();
372 372 }
373 373 });
374 374 }
375 375
376 376 function setPredecessorFieldsVisibility() {
377 377 var relationType = $('#relation_relation_type');
378 378 if (relationType.val() == "precedes" || relationType.val() == "follows") {
379 379 $('#predecessor_fields').show();
380 380 } else {
381 381 $('#predecessor_fields').hide();
382 382 }
383 383 }
384 384
385 385 function showModal(id, width, title) {
386 386 var el = $('#'+id).first();
387 387 if (el.length === 0 || el.is(':visible')) {return;}
388 388 if (!title) title = el.find('h3.title').text();
389 389 // moves existing modals behind the transparent background
390 390 $(".modal").zIndex(99);
391 391 el.dialog({
392 392 width: width,
393 393 modal: true,
394 394 resizable: false,
395 395 dialogClass: 'modal',
396 396 title: title
397 397 }).on('dialogclose', function(){
398 398 $(".modal").zIndex(101);
399 399 });
400 400 el.find("input[type=text], input[type=submit]").first().focus();
401 401 }
402 402
403 403 function hideModal(el) {
404 404 var modal;
405 405 if (el) {
406 406 modal = $(el).parents('.ui-dialog-content');
407 407 } else {
408 408 modal = $('#ajax-modal');
409 409 }
410 410 modal.dialog("close");
411 411 }
412 412
413 413 function submitPreview(url, form, target) {
414 414 $.ajax({
415 415 url: url,
416 416 type: 'post',
417 417 data: $('#'+form).serialize(),
418 418 success: function(data){
419 419 $('#'+target).html(data);
420 420 }
421 421 });
422 422 }
423 423
424 424 function collapseScmEntry(id) {
425 425 $('.'+id).each(function() {
426 426 if ($(this).hasClass('open')) {
427 427 collapseScmEntry($(this).attr('id'));
428 428 }
429 429 $(this).hide();
430 430 });
431 431 $('#'+id).removeClass('open');
432 432 }
433 433
434 434 function expandScmEntry(id) {
435 435 $('.'+id).each(function() {
436 436 $(this).show();
437 437 if ($(this).hasClass('loaded') && !$(this).hasClass('collapsed')) {
438 438 expandScmEntry($(this).attr('id'));
439 439 }
440 440 });
441 441 $('#'+id).addClass('open');
442 442 }
443 443
444 444 function scmEntryClick(id, url) {
445 445 var el = $('#'+id);
446 446 if (el.hasClass('open')) {
447 447 collapseScmEntry(id);
448 448 el.addClass('collapsed');
449 449 return false;
450 450 } else if (el.hasClass('loaded')) {
451 451 expandScmEntry(id);
452 452 el.removeClass('collapsed');
453 453 return false;
454 454 }
455 455 if (el.hasClass('loading')) {
456 456 return false;
457 457 }
458 458 el.addClass('loading');
459 459 $.ajax({
460 460 url: url,
461 461 success: function(data) {
462 462 el.after(data);
463 463 el.addClass('open').addClass('loaded').removeClass('loading');
464 464 }
465 465 });
466 466 return true;
467 467 }
468 468
469 469 function randomKey(size) {
470 470 var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
471 471 var key = '';
472 472 for (var i = 0; i < size; i++) {
473 473 key += chars.charAt(Math.floor(Math.random() * chars.length));
474 474 }
475 475 return key;
476 476 }
477 477
478 478 function updateIssueFrom(url, el) {
479 479 $('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
480 480 $(this).data('valuebeforeupdate', $(this).val());
481 481 });
482 482 if (el) {
483 483 $("#form_update_triggered_by").val($(el).attr('id'));
484 484 }
485 485 return $.ajax({
486 486 url: url,
487 487 type: 'post',
488 488 data: $('#issue-form').serialize()
489 489 });
490 490 }
491 491
492 492 function replaceIssueFormWith(html){
493 493 var replacement = $(html);
494 494 $('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
495 495 var object_id = $(this).attr('id');
496 496 if (object_id && $(this).data('valuebeforeupdate')!=$(this).val()) {
497 497 replacement.find('#'+object_id).val($(this).val());
498 498 }
499 499 });
500 500 $('#all_attributes').empty();
501 501 $('#all_attributes').prepend(replacement);
502 502 }
503 503
504 504 function updateBulkEditFrom(url) {
505 505 $.ajax({
506 506 url: url,
507 507 type: 'post',
508 508 data: $('#bulk_edit_form').serialize()
509 509 });
510 510 }
511 511
512 512 function observeAutocompleteField(fieldId, url, options) {
513 513 $(document).ready(function() {
514 514 $('#'+fieldId).autocomplete($.extend({
515 515 source: url,
516 516 minLength: 2,
517 position: {collision: "flipfit"},
517 518 search: function(){$('#'+fieldId).addClass('ajax-loading');},
518 519 response: function(){$('#'+fieldId).removeClass('ajax-loading');}
519 520 }, options));
520 521 $('#'+fieldId).addClass('autocomplete');
521 522 });
522 523 }
523 524
524 525 function observeSearchfield(fieldId, targetId, url) {
525 526 $('#'+fieldId).each(function() {
526 527 var $this = $(this);
527 528 $this.addClass('autocomplete');
528 529 $this.attr('data-value-was', $this.val());
529 530 var check = function() {
530 531 var val = $this.val();
531 532 if ($this.attr('data-value-was') != val){
532 533 $this.attr('data-value-was', val);
533 534 $.ajax({
534 535 url: url,
535 536 type: 'get',
536 537 data: {q: $this.val()},
537 538 success: function(data){ if(targetId) $('#'+targetId).html(data); },
538 539 beforeSend: function(){ $this.addClass('ajax-loading'); },
539 540 complete: function(){ $this.removeClass('ajax-loading'); }
540 541 });
541 542 }
542 543 };
543 544 var reset = function() {
544 545 if (timer) {
545 546 clearInterval(timer);
546 547 timer = setInterval(check, 300);
547 548 }
548 549 };
549 550 var timer = setInterval(check, 300);
550 551 $this.bind('keyup click mousemove', reset);
551 552 });
552 553 }
553 554
554 555 function beforeShowDatePicker(input, inst) {
555 556 var default_date = null;
556 557 switch ($(input).attr("id")) {
557 558 case "issue_start_date" :
558 559 if ($("#issue_due_date").size() > 0) {
559 560 default_date = $("#issue_due_date").val();
560 561 }
561 562 break;
562 563 case "issue_due_date" :
563 564 if ($("#issue_start_date").size() > 0) {
564 565 var start_date = $("#issue_start_date").val();
565 566 if (start_date != "") {
566 567 start_date = new Date(Date.parse(start_date));
567 568 if (start_date > new Date()) {
568 569 default_date = $("#issue_start_date").val();
569 570 }
570 571 }
571 572 }
572 573 break;
573 574 }
574 575 $(input).datepicker("option", "defaultDate", default_date);
575 576 }
576 577
577 578 function initMyPageSortable(list, url) {
578 579 $('#list-'+list).sortable({
579 580 connectWith: '.block-receiver',
580 581 tolerance: 'pointer',
581 582 update: function(){
582 583 $.ajax({
583 584 url: url,
584 585 type: 'post',
585 586 data: {'blocks': $.map($('#list-'+list).children(), function(el){return $(el).attr('id');})}
586 587 });
587 588 }
588 589 });
589 590 $("#list-top, #list-left, #list-right").disableSelection();
590 591 }
591 592
592 593 var warnLeavingUnsavedMessage;
593 594 function warnLeavingUnsaved(message) {
594 595 warnLeavingUnsavedMessage = message;
595 596 $(document).on('submit', 'form', function(){
596 597 $('textarea').removeData('changed');
597 598 });
598 599 $(document).on('change', 'textarea', function(){
599 600 $(this).data('changed', 'changed');
600 601 });
601 602 window.onbeforeunload = function(){
602 603 var warn = false;
603 604 $('textarea').blur().each(function(){
604 605 if ($(this).data('changed')) {
605 606 warn = true;
606 607 }
607 608 });
608 609 if (warn) {return warnLeavingUnsavedMessage;}
609 610 };
610 611 }
611 612
612 613 function setupAjaxIndicator() {
613 614 $(document).bind('ajaxSend', function(event, xhr, settings) {
614 615 if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') {
615 616 $('#ajax-indicator').show();
616 617 }
617 618 });
618 619 $(document).bind('ajaxStop', function() {
619 620 $('#ajax-indicator').hide();
620 621 });
621 622 }
622 623
623 624 function hideOnLoad() {
624 625 $('.hol').hide();
625 626 }
626 627
627 628 function addFormObserversForDoubleSubmit() {
628 629 $('form[method=post]').each(function() {
629 630 if (!$(this).hasClass('multiple-submit')) {
630 631 $(this).submit(function(form_submission) {
631 632 if ($(form_submission.target).attr('data-submitted')) {
632 633 form_submission.preventDefault();
633 634 } else {
634 635 $(form_submission.target).attr('data-submitted', true);
635 636 }
636 637 });
637 638 }
638 639 });
639 640 }
640 641
641 642 function defaultFocus(){
642 643 if (($('#content :focus').length == 0) && (window.location.hash == '')) {
643 644 $('#content input[type=text], #content textarea').first().focus();
644 645 }
645 646 }
646 647
647 648 function blockEventPropagation(event) {
648 649 event.stopPropagation();
649 650 event.preventDefault();
650 651 }
651 652
652 653 function toggleDisabledOnChange() {
653 654 var checked = $(this).is(':checked');
654 655 $($(this).data('disables')).attr('disabled', checked);
655 656 $($(this).data('enables')).attr('disabled', !checked);
656 657 }
657 658 function toggleDisabledInit() {
658 659 $('input[data-disables], input[data-enables]').each(toggleDisabledOnChange);
659 660 }
660 661 $(document).ready(function(){
661 662 $('#content').on('change', 'input[data-disables], input[data-enables]', toggleDisabledOnChange);
662 663 toggleDisabledInit();
663 664 });
664 665
665 666 function keepAnchorOnSignIn(form){
666 667 var hash = decodeURIComponent(self.document.location.hash);
667 668 if (hash) {
668 669 if (hash.indexOf("#") === -1) {
669 670 hash = "#" + hash;
670 671 }
671 672 form.action = form.action + hash;
672 673 }
673 674 return true;
674 675 }
675 676
676 677 $(document).ready(setupAjaxIndicator);
677 678 $(document).ready(hideOnLoad);
678 679 $(document).ready(addFormObserversForDoubleSubmit);
679 680 $(document).ready(defaultFocus);
General Comments 0
You need to be logged in to leave comments. Login now