Skip to content

configure maxHeight #25

@albfan

Description

@albfan

A scroll modal window could be interesting:

diff --git i/static/js/L.Control.Window.js w/static/js/L.Control.Window.js
index 45b2b76..5f31b7d 100644
--- i/static/js/L.Control.Window.js
+++ w/static/js/L.Control.Window.js
@@ -273,11 +273,14 @@ L.Control.Window = L.Control.extend({
             margin += this._containerPromptButtons.offsetHeight-20
         }
 
-        var el =  L.DomUtil.get(this.options.element)
-        var rect = el.getBoundingClientRect();
-        var height = rect.bottom -rect.top;
+        var maxHeight = this.options.maxHeight;
+        if (maxHeight==undefined) {
+            var el =  L.DomUtil.get(this.options.element)
+            var rect = el.getBoundingClientRect();
+            var height = rect.bottom -rect.top;
 
-        var maxHeight = height - margin;
+            var maxHeight = height - margin;
+        }
         this._containerContent.setAttribute('style','max-height:'+maxHeight+'px')
     },
     close : function(){

this would need a css to add scrolling:

 .content {
   padding: 10px !important;
   margin: 10px !important
   overflow-y: scroll;
}

.control-window {
  max-height: 400px;
  overflow: hidden;
 }

NOTE: Max heigth for control-window would depend on maxHeight set to content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions