You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by up...@apache.org on 2015/11/03 12:47:03 UTC

svn commit: r1712263 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/webapp/ solr/webapp/web/index.html solr/webapp/web/js/angular/app.js

Author: upayavira
Date: Tue Nov  3 11:47:03 2015
New Revision: 1712263

URL: http://svn.apache.org/viewvc?rev=1712263&view=rev
Log:
SOLR-8210 Scroll menu when browser window is small

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/webapp/   (props changed)
    lucene/dev/branches/branch_5x/solr/webapp/web/index.html
    lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/index.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/index.html?rev=1712263&r1=1712262&r2=1712263&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/index.html (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/index.html Tue Nov  3 11:47:03 2015
@@ -80,7 +80,7 @@ limitations under the License.
 </head>
 <body ng-controller="MainController">
 
-  <div id="wrapper">
+  <div id="wrapper" scrollable-when-small>
 
     <div id="header">
 

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js?rev=1712263&r1=1712262&r2=1712263&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js Tue Nov  3 11:47:03 2015
@@ -156,6 +156,20 @@ solrAdminApp.config([
     }
   };
 })
+.directive('scrollableWhenSmall', function($window) {
+  return {
+    link: function(scope, element, attrs) {
+      var w = angular.element($window);
+
+      var checkFixedMenu = function() {
+        var shouldScroll = w.height() < (element.height() + $('#header').height() + 40);
+        element.toggleClass( 'scroll', shouldScroll);
+      };
+      w.bind('resize', checkFixedMenu);
+      w.bind('load', checkFixedMenu);
+    }
+  }
+})
 .filter('readableSeconds', function() {
     return function(input) {
     seconds = parseInt(input||0, 10);
@@ -680,8 +694,6 @@ var solr_admin = function( app_config )
         // load cores (indexInfo = false
         success : function( response )
         {
-          check_fixed_menu();
-          $( window ).resize( check_fixed_menu );
 
           var system_url = config.solr_path + '/admin/info/system?wt=json';
           $.ajax
@@ -762,9 +774,4 @@ var solr_admin = function( app_config )
                   '</code></pre></div>'
                 );
   };
-
-  check_fixed_menu = function check_fixed_menu()
-  {
-    $( '#wrapper' ).toggleClass( 'scroll', $( window ).height() < $( '#menu-wrapper' ).height() + $( '#header' ).height() + 40 );
-  }
 */