annotate .svn/pristine/b9/b9c054d6539805d812fa35be587a1c5bf3159ea1.svn-base @ 1519:afce8026aaeb redmine-2.4-integration

Merge from branch "live"
author Chris Cannam
date Tue, 09 Sep 2014 09:34:53 +0100
parents 038ba2d95de8
children
rev   line source
Chris@1296 1 $(document).ready(function() {
Chris@1296 2 /*
Chris@1296 3 If we're viewing a tag or branch, don't display it in the
Chris@1296 4 revision box
Chris@1296 5 */
Chris@1296 6 var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val();
Chris@1296 7 var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val();
Chris@1296 8 if (branch_selected || tag_selected) {
Chris@1296 9 $('#rev').val('');
Chris@1296 10 }
Chris@1296 11
Chris@1296 12 /*
Chris@1296 13 Copy the branch/tag value into the revision box, then disable
Chris@1296 14 the dropdowns before submitting the form
Chris@1296 15 */
Chris@1296 16 $('#branch,#tag').change(function() {
Chris@1296 17 $('#rev').val($(this).val());
Chris@1296 18 $('#branch,#tag').attr('disabled', true);
Chris@1296 19 $(this).parent().submit();
Chris@1296 20 $('#branch,#tag').removeAttr('disabled');
Chris@1296 21 });
Chris@1296 22
Chris@1296 23 /*
Chris@1296 24 Disable the branch/tag dropdowns before submitting the revision form
Chris@1296 25 */
Chris@1296 26 $('#rev').keydown(function(e) {
Chris@1296 27 if (e.keyCode == 13) {
Chris@1296 28 $('#branch,#tag').attr('disabled', true);
Chris@1296 29 $(this).parent().submit();
Chris@1296 30 $('#branch,#tag').removeAttr('disabled');
Chris@1296 31 }
Chris@1296 32 });
Chris@1296 33 })