changeset 4366:cc5300a1f2ac

pull requests: use select2 for branch and revision selection
author Mads Kiilerich <madski@unity3d.com>
date Fri, 04 Jul 2014 14:12:06 +0200
parents 3abfe76f1ac7
children 7879d8d88672
files kallithea/public/css/style.css kallithea/templates/pullrequests/pullrequest.html
diffstat 2 files changed, 36 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/css/style.css	Fri Jul 18 19:22:01 2014 +0200
+++ b/kallithea/public/css/style.css	Fri Jul 04 14:12:06 2014 +0200
@@ -4804,6 +4804,14 @@
     max-width: 978px;
 }
 
+#s2id_org_ref,
+#s2id_other_ref,
+#s2id_org_repo,
+#s2id_other_repo {
+    min-width: 150px;
+    margin: 5px;
+}
+
 /****
   PERMS
 *****/
--- a/kallithea/templates/pullrequests/pullrequest.html	Fri Jul 18 19:22:01 2014 +0200
+++ b/kallithea/templates/pullrequests/pullrequest.html	Fri Jul 04 14:12:06 2014 +0200
@@ -210,25 +210,39 @@
       });
   }
 
-  ## refresh automatically when something changes (org_repo can't change)
+  YAHOO.util.Event.onDOMReady(function(){
+      $("#org_repo").select2({
+          dropdownAutoWidth: true,
+      });
+      ## (org_repo can't change)
+
+      $("#org_ref").select2({
+          dropdownAutoWidth: true,
+      });
+      $("#org_ref").on("change", function(e){
+          loadPreview();
+      });
 
-  YUE.on('org_ref', 'change', function(e){
-     loadPreview();
-  });
+      $("#other_repo").select2({
+          dropdownAutoWidth: true,
+      });
+      $("#other_repo").on("change", function(e){
+          otherrepoChanged();
+          loadPreview();
+      });
 
-  YUE.on('other_repo', 'change', function(e){
+      $("#other_ref").select2({
+          dropdownAutoWidth: true,
+      });
+      $("#other_ref").on("change", function(e){
+          loadPreview();
+      });
+
       otherrepoChanged();
-      loadPreview();
+      //lazy load overview after 0.5s
+      setTimeout(loadPreview, 500);
   });
 
-  YUE.on('other_ref', 'change', function(e){
-     loadPreview();
-  });
-
-  otherrepoChanged();
-  //lazy load overview after 0.5s
-  setTimeout(loadPreview, 500);
-
 </script>
 
 </%def>