{"_id":"maximize-select2-height","_rev":"6-5e07fee5d04ea93ed3cb2677c0ae0ba3","name":"maximize-select2-height","description":"Automagically maximize the height of a Select2 dropdown to take advantage of the space available on the page.","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"maximize-select2-height","version":"1.0.0","description":"Automagically maximize the height of a Select2 dropdown to take advantage of the space available on the page.","main":"maximize-select2-height.js","repository":{"type":"git","url":"git+https://github.com/panorama-ed/maximize-select2-height.git"},"keywords":["jquery-plugin","ecosystem:jquery","select2"],"author":{"name":"Panorama Education"},"license":"MIT","bugs":{"url":"https://github.com/panorama-ed/maximize-select2-height/issues"},"homepage":"https://github.com/panorama-ed/maximize-select2-height#readme","dependencies":{"select2":"^4.0.0"},"gitHead":"ba7ff397e7c9cd5e33061249ee28ee653666e5a1","_id":"maximize-select2-height@1.0.0","scripts":{},"_shasum":"deb1b5d2ad365a549c94fc1f559bdb0092ca5e3f","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"jacobevelyn","email":"jevelyn@panoramaed.com"},"dist":{"shasum":"deb1b5d2ad365a549c94fc1f559bdb0092ca5e3f","tarball":"https://registry.npmjs.org/maximize-select2-height/-/maximize-select2-height-1.0.0.tgz","integrity":"sha512-cgovugA+X2w3fb558qGADqkY5a/d6f5INCQH0KlmMEUkJbkv2Ki87M/X7ePCwvqKrJfSwByT3GK7A0iiPxtAug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0IIERbHseatqLOHYI7msuIIYUUHH8/5TDm+XawElt9AiEAjQZ5L9s9UbT3Y1zK1Wp0UjvhlBJcdINvhIk0fKfWq9I="}]},"maintainers":[{"name":"jacobevelyn","email":"jevelyn@panoramaed.com"}],"directories":{}},"1.0.3":{"name":"maximize-select2-height","version":"1.0.3","description":"Automagically maximize the height of a Select2 dropdown to take advantage of the space available on the page.","main":"maximize-select2-height.js","repository":{"type":"git","url":"git+https://github.com/panorama-ed/maximize-select2-height.git"},"keywords":["jquery-plugin","ecosystem:jquery","select2"],"author":{"name":"Panorama Education"},"license":"MIT","bugs":{"url":"https://github.com/panorama-ed/maximize-select2-height/issues"},"homepage":"https://github.com/panorama-ed/maximize-select2-height#readme","dependencies":{"select2":"^4.0.0"},"gitHead":"1e2baecb9045fe671fd2613d570ac439f45aa7c2","_id":"maximize-select2-height@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"10.2.1","_npmUser":{"name":"jacobevelyn","email":"jevelyn@panoramaed.com"},"dist":{"integrity":"sha512-9Dvnd9xD+Rui1F9iDQFi6ywQ/WSmlQbcL5qmLNiFYRi/MlXPG9sI2jq2Jx89IyY1M/517mjD4cMi1690WvEfOw==","shasum":"78975ccca942b84bda08eb66ad6c991bf175e70c","tarball":"https://registry.npmjs.org/maximize-select2-height/-/maximize-select2-height-1.0.3.tgz","fileCount":5,"unpackedSize":13785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbJ6CCRA9TVsSAnZWagAA9kAP/jjwq5YrVitzOXgJpAmu\ni8kwDenuF/MmIe16NlfDWyf0RbN8NY3sqaCesIBTAq27AqiXvZZkLnSq85Q3\n/6T2uupFpHd4Y1qyYZx34iIIIn97UIgELwothsdplUk2HDttjyUPfaiIL/G+\neOn60ydm30S4OFDbZb+fr2Xb9OZ83OLBv45Y30m/iKhXr48b4j80Vg733pHK\nrJHdHzHoMwhD+Ep8586VnnWCEGMeQ5QVpjws2Tdgx9big5PU5jfMSqpFSf2n\n0Z/t7wy0KePKqF13wBexcFp9i6Gb/jdyxgX+gRicCHDlYr2TMeDZ2UgC4dYS\n1VGsxtB6BLF9HOUOAAcW6xDu6a9OkZtjWWTg2td9z9A4ZQh1qSfj0+5tIiLF\nJQaEdFpc7UUT0m4Kz11QQVEu3H4rPjltd+eisu/bIGvxyFtgMA8dfxCdfRvz\npYu9NnP/EShFNyUxz9sM2xT7cGDdkURkadMAMR+LLreTgvsxJS6nFjwzwPpX\nyBUAcA1YULChUwAX5Ty+9f0Ip3v1Pt3HbqbfIt0U0BHFVAJQ/ViEV+gxbLdk\nQ4zsQ8d/awf3KJcL9JD5HYyh558Hcz21tU393HadWaFACqVCAG8/wV6uGRJ0\nXLlE9yyCS/9oN3YmG+RwQkKM76nNaM2DG71oFXffh8CVJKivT8mQJN1vbgyu\nZyzs\r\n=/wVP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZfPAYnN8yAPl1nZeZG09o6lncC6PtRLN2l0Br5VhAYAiEA5xD1F0fPMTYRccEztgpSrhhwfTxd7qrOqHXs/mn2iJw="}]},"maintainers":[{"name":"jacobevelyn","email":"jevelyn@panoramaed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/maximize-select2-height_1.0.3_1533845122385_0.5874945770568123"},"_hasShrinkwrap":false},"1.0.4":{"name":"maximize-select2-height","version":"1.0.4","description":"Automagically maximize the height of a Select2 dropdown to take advantage of the space available on the page.","main":"maximize-select2-height.js","repository":{"type":"git","url":"git+https://github.com/panorama-ed/maximize-select2-height.git"},"keywords":["jquery-plugin","ecosystem:jquery","select2"],"author":{"name":"Panorama Education"},"license":"MIT","bugs":{"url":"https://github.com/panorama-ed/maximize-select2-height/issues"},"homepage":"https://github.com/panorama-ed/maximize-select2-height#readme","dependencies":{"select2":"^4.0.0"},"gitHead":"bb742e87cfecf09b4b61fce814c68a8777913215","_id":"maximize-select2-height@1.0.4","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-rJFy0RMiS7fbHgbxn2Z/gjYInYkhcFKeQaydI9ghpTPrQGGY6NvPTPlhy7KThzbPVKo5L3vqceSx46CwN5NhUw==","shasum":"6ecbd43c73902f012ef9d096e0cf9f635d0ea0fe","tarball":"https://registry.npmjs.org/maximize-select2-height/-/maximize-select2-height-1.0.4.tgz","fileCount":5,"unpackedSize":19075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWV98CRA9TVsSAnZWagAA/Z0P/3sIyLdMmZKQQOtZv1qx\nG+7R754nPA5dzVPyi7lfctGVkeG6ii01Mz+t/h3nWAakoH+ylsv2D99In9Mk\nK7UlvTiqj95rmL4LxcfDLG/0t75IRpudolZM/Um8+0lRRXnz5K88OObBuDTo\ndelCS+CI7ZU0mMr4ZtKO8ISQtKPCCjtHaNB5OLHO6Wm52FZkNLBrJPd7dfQj\nS7sCmcUZC33LBmBdWV72RB4w2QviOuItzl7QxIQ3vYHYjCg9pSGF3Gi1B+Ij\n8WzxAypEsoao5hyWn8Wb58Hd+opbEP+G06oLdfOCvY0gv/eWUpDZ7C2PXWdv\nhvOAa7FW1ipFRdGFNwDsCGI62XiA1Z3o5mYfw9Jj09kAHeFGSwSnIXwbze3H\n9M0VElAAZvfBPmveFTXxcGqevpQ2iWhJjQcmFg/eJ7Uv8NOcIi0uBdiQfX1Z\nB0GHRrdqHUZmzSgrQ80ecxiuYX+En29WBXeVWAhkqt8F3OvnkzOnq21tGluM\nchLgY+by9gpzkYP3u0j/j8Jak9CLqxVqaDlrStavixO6Api9rv8a+UAdx87d\n2OB2BvavGp6MUwMg1epVqN9gxSR7hW5SgSwFHNd2quiOJnI3Je8tcUlOx30j\neaNNq6TUYaZbq/nXdndkORFn2odne63wUJgs/tdKc6H7zzS1IKs3mDHdUDrW\nqeUP\r\n=+c4j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0TwpX0uINXIVcp6WJdNhBKhwWl/SB/kA+K/6oWkDXWwIgEMKpsahh/JTqgj1XzeIYuyx/3E+YPTiJvks4S67U5fY="}]},"maintainers":[{"name":"jacobevelyn","email":"jevelyn@panoramaed.com"}],"_npmUser":{"name":"jacobevelyn","email":"jacobevelyn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/maximize-select2-height_1.0.4_1582915452490_0.07190208196437675"},"_hasShrinkwrap":false}},"readme":"# maximize-select2-height\n\nThis package is short and simple. It magically expands your [Select2](https://select2.github.io) dropdowns to fill the height of the window.\n\nIt factors in the number of elements in the dropdown, the position of the\nSelect2 on the page, the size and scroll position of the page, the visibility\nof scroll bars, and whether the dropdown is rendered upwards or downwards. And\nit resizes itself each time the dropdown is opened. And minified, it's **~800 bytes** (including comments)!\n\n*(Note that this plugin is built for Select2 v4.x.x only.)*\n\n## Installation\n\n```bash\nnpm install maximize-select2-height\n```\n\nOr download it directly from [npm](https://www.npmjs.com/package/maximize-select2-height).\n\nOr clone this repository.\n\nOr copy-paste the `minimize-select2-height.js` or\n`minimize-select2-height.min.js` file into your project directly.\n\n## Usage\n\nAnywhere you initialize a Select2 dropdown like so:\n\n```javascript\n$(\"#my-dropdown\").select2();\n```\n\nSimply chain the magic method on:\n\n```javascript\n$(\"#my-dropdown\").select2().maximizeSelect2Height();\n```\n\nAnd your dropdowns will go from being an arbitrary hardcoded height:\n\n![Select2's default behavior](https://cloud.githubusercontent.com/assets/1114569/9886899/b85b8924-5bba-11e5-9b08-f63d012652d3.png)\n\nTo showing all options when there is room in the window for all of them:\n\n![When there is room for all options to be displayed](https://cloud.githubusercontent.com/assets/1114569/9886898/b85a2a70-5bba-11e5-8695-b41e84af4a18.png)\n\nAnd intelligently shrinking where there isn't:\n\n![When there isn't room for all options to be displayed](https://cloud.githubusercontent.com/assets/1114569/9886900/b85dbee2-5bba-11e5-9544-19bdc6ca9752.png)\n\nThe height is adjusted slightly when a horizontal scroll bar is present, to\nprevent the scroll bar from obscuring the dropdown:\n\n![When a scroll bar would obscure the dropdown](https://cloud.githubusercontent.com/assets/1114569/9905981/0c9d5030-5c56-11e5-86b5-bb10e1d9bd7d.png)\n\nAnd the height automatically adjusts when Select2 decides to render a dropdown\nupwards instead of downwards:\n\n![When the dropdown is rendered upwards](https://cloud.githubusercontent.com/assets/1114569/9906104/9e3083f0-5c56-11e5-89f3-4fb41a43b916.png)\n\n## Advanced Usage\n\nYou can adjust how much extra space is left between the edge of the open\ndropdown and the edge of the viewport with the `cushion` option:\n\n```javascript\n$(\"#my-dropdown\").select2().maximizeSelect2Height({\n  cushion: 50 // Must be a numerical pixel value.\n});\n```\n\nNote that when a `cushion` is passed, the code will not adjust spacing for the\npresence of a horizontal scroll bar, to allow for maximum control.\n\n![With a custom bottom margin](https://cloud.githubusercontent.com/assets/1114569/9886897/b85714e8-5bba-11e5-80d7-c76be11d1dd9.png)\n\n## Note\n\n**This plugin requires a unique ID on the** `<select></select>`\n**DOM element to work (though you don't have to select by ID with\njQuery when you initialize this).**\n","maintainers":[{"name":"jacobevelyn","email":"jevelyn@panoramaed.com"}],"time":{"modified":"2022-06-19T17:00:12.067Z","created":"2015-09-16T19:40:00.659Z","1.0.0":"2015-09-16T19:40:00.659Z","1.0.3":"2018-08-09T20:05:22.456Z","1.0.4":"2020-02-28T18:44:12.670Z"},"homepage":"https://github.com/panorama-ed/maximize-select2-height#readme","keywords":["jquery-plugin","ecosystem:jquery","select2"],"repository":{"type":"git","url":"git+https://github.com/panorama-ed/maximize-select2-height.git"},"author":{"name":"Panorama Education"},"bugs":{"url":"https://github.com/panorama-ed/maximize-select2-height/issues"},"license":"MIT","readmeFilename":"README.md"}