//-- copyright
// Copyright (C) 2012-2014 the OpenProject Foundation (OPF)
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
// See doc/COPYRIGHT.rdoc for more details.
Event.observe(window,"load",function(){var e=$("branch")&&$("rev").getValue()==$("branch").getValue(),t=$("tag")&&$("rev").getValue()==$("tag").getValue();(e||t)&&$("rev").setValue(""),$$("#branch,#tag").each(function(e){e.observe("change",function(e){$("rev").setValue(e.element().getValue()),$$("#branch,#tag").invoke("disable"),e.element().parentNode.submit(),$$("#branch,#tag").invoke("enable")})}),$("rev").observe("keydown",function(e){13==e.keyCode&&($$("#branch,#tag").invoke("disable"),e.element().parentNode.submit(),$$("#branch,#tag").invoke("enable"))})});