├── .gitignore ├── src ├── less │ ├── variables.less │ └── fs-modal.less └── js │ └── fs-modal.js ├── package.json ├── Gruntfile.js ├── LICENSE.txt ├── dist ├── css │ ├── fs-modal.min.css │ └── fs-modal.css └── js │ └── fs-modal.min.js ├── README.md └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /temp 3 | -------------------------------------------------------------------------------- /src/less/variables.less: -------------------------------------------------------------------------------- 1 | @modal-fullscreen-mobile-header-height: 50px; 2 | @modal-fullscreen-mobile-content-padding: 7px; 3 | @modal-fullscreen-mobile-header-background: #f8f8f8; 4 | @modal-fullscreen-mobile-header-border-color: #e7e7e7; 5 | @modal-fullscreen-mobile-header-font-size: 22px; 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-fs-modal", 3 | "version": "0.3.6", 4 | "license": "MIT", 5 | "description": "A simple way to improve Bootstrap modals UX on mobile phones", 6 | "author": { 7 | "name": "Oleksandr Popov", 8 | "url": "github.com/keaukraine/" 9 | }, 10 | "repository" : 11 | { 12 | "type" : "git", 13 | "url" : "https://github.com/keaukraine/bootstrap-fs-modal.git" 14 | }, 15 | "devDependencies": {}, 16 | "dependencies": { 17 | "bootstrap": "^3.3.7", 18 | "grunt": "^1.0.1", 19 | "grunt-contrib-cssmin": "^2.2.0", 20 | "grunt-contrib-less": "^1.4.1", 21 | "grunt-contrib-uglify": "^3.0.1" 22 | }, 23 | "keywords": [ 24 | "twitter", 25 | "bootstrap", 26 | "modal", 27 | "responsive", 28 | "mobile", 29 | "javascript", 30 | "jquery", 31 | "jquery-plugin" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | grunt.initConfig({ 3 | less: { 4 | development: { 5 | files: { 6 | 'dist/css/fs-modal.css': 'src/less/fs-modal.less' 7 | } 8 | } 9 | }, 10 | cssmin: { 11 | target: { 12 | files: { 13 | 'dist/css/fs-modal.min.css': ['dist/css/fs-modal.css'] 14 | } 15 | } 16 | }, 17 | uglify: { 18 | my_target: { 19 | files: { 20 | 'dist/js/fs-modal.min.js': ['src/js/fs-modal.js'], 21 | }, 22 | }, 23 | } 24 | }); 25 | 26 | grunt.loadNpmTasks('grunt-contrib-less'); 27 | grunt.loadNpmTasks('grunt-contrib-cssmin'); 28 | grunt.loadNpmTasks('grunt-contrib-uglify'); 29 | 30 | grunt.registerTask('default', ['less', 'cssmin', 'uglify']); 31 | }; 32 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Oleksandr Popov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 4 | files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, 5 | modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software 6 | is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 11 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 12 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 13 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | -------------------------------------------------------------------------------- /dist/css/fs-modal.min.css: -------------------------------------------------------------------------------- 1 | @media (max-width:992px){.modal.modal-fullscreen{box-shadow:0 0 0 100px #fff}.modal.modal-fullscreen .modal-dialog{margin:0;width:100%;height:100%}.modal.modal-fullscreen .modal-dialog .modal-content{border:none;border-radius:0;box-shadow:none;position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden}.modal.modal-fullscreen .modal-dialog .modal-content .modal-header{position:absolute;left:0;right:0;top:0;z-index:1;height:50px;padding:0;line-height:50px;background-color:#f8f8f8;border-color:#e7e7e7}.modal.modal-fullscreen .modal-dialog .modal-content .modal-header .modal-title{display:inline-block;line-height:50px;position:absolute}.modal.modal-fullscreen .modal-dialog .modal-content .modal-header .btn{vertical-align:top;height:50px}.modal.modal-fullscreen .modal-dialog .modal-content .modal-header .btn .glyphicon{font-size:22px}.modal.modal-fullscreen .modal-dialog .modal-content .modal-header .close{display:none}.modal.modal-fullscreen .modal-dialog .modal-content .modal-header .fullscreen-buttons{position:relative;z-index:1;background-color:#f8f8f8;height:calc(49px)}.modal.modal-fullscreen .modal-dialog .modal-content .modal-body{position:absolute;top:50px;left:0;right:0;bottom:0;overflow:scroll;padding:7px}.modal.modal-fullscreen .modal-dialog .modal-content .modal-footer{display:none}}@media (min-width:992px){.modal.modal-fullscreen .modal-dialog .modal-content .modal-header .btn{display:none}} -------------------------------------------------------------------------------- /dist/js/fs-modal.min.js: -------------------------------------------------------------------------------- 1 | $(function(){var t=0;$("body").on("show.bs.modal",".modal.modal-fullscreen",function(){var a,o=$(this),n=o.find('.modal-footer .btn:not([data-dismiss="modal"])');o.find(".modal-header .pull-right, .modal-header [data-additional-close]").remove(),$('
').prependTo(o.find(".modal-header")),$.each(n,function(){var a,n=t++,d=$(this),l=d.data("glyphicon"),e=d.data("faicon"),i=d.data("mobileText")||d.text();$(this).attr("data-button-tag",n),l||e?(a=$(" 41 | 42 | 43 | 44 | 45 |
46 | ``` 47 | 48 | That's all you need. JS automatically tracks `show.bs.modal` events and duplicates all buttons to modal header, wiring `click` events to original buttons. 49 | 50 | 51 | ## Used Libraries 52 | * Twitter Bootstrap used under the MIT License https://github.com/twbs/bootstrap/blob/master/LICENSE 53 | * jQuery used under the MIT license https://jquery.org/license/ 54 | 55 | 56 | ## License 57 | 58 | **The MIT License** 59 | 60 | Copyright (c) 2017 Oleksandr Popov 61 | 62 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 63 | 64 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 65 | 66 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 67 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Fullscreen Mobile Modal Test Page 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |

Fullscreen Mobile Modal Test Page

17 |
18 |
19 |

20 | 23 |

24 |
25 |
26 |

27 | 30 |

31 |
32 |
33 |

34 | 37 |

38 |
39 |
40 |

41 | 44 |

45 |
46 |
47 |

Sample content to fill page

48 |

49 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed dui tempor, finibus ligula vitae, convallis mi. Sed posuere at neque nec hendrerit. Sed vitae felis gravida, ultricies dui eget, venenatis leo. Nunc hendrerit tellus non velit malesuada, eu dapibus sapien placerat. Sed non viverra magna, sit amet ornare erat. Fusce eros mi, consequat ac elit vel, ullamcorper molestie mauris. Proin auctor orci eget lacinia condimentum. Phasellus ultricies ligula id lacinia posuere. Nulla rutrum eros eu arcu tempor, imperdiet ornare lectus convallis. Nulla eleifend dapibus sem, vel viverra sapien. 50 |

51 |

52 | Integer interdum ex augue, vel egestas nibh fermentum eu. Cras ut erat eu nisi ullamcorper scelerisque vitae in lorem. In hac habitasse platea dictumst. Pellentesque ino semper mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus pellentesque purus porta maximus blandit. Suspendisse id lorem pellentesque, vehicula nulla at, congue eros. Duis eleifend semper sodales. Morbi eu sagittis ex. Praesent commodo rhoncus nisi. Aenean quis arcu mauris. 53 |

54 |

55 | Donec eget ex ut nibh ullamcorper commodo. Aenean ac faucibus mi. Nullam luctus dui diam, in congue sem fringilla et. Vivamus non metus at elit ornare maximus. Nam iaculis ex in dolor rutrum, at facilisis dolor euismod. Sed lacinia sagittis lobortis. Suspendisse turpis tellus, pharetra scelerisque odio eget, condimentum tempus nibh. Praesent in diam ac sapien dignissim luctus a quis sapien. Duis sed lacus magna. Maecenas at fringilla quam. Ut purus risus, ultricies eget risus ut, convallis hendrerit eros. Fusce vehicula libero quam, nec cursus nulla interdum eu. Quisque commodo suscipit justo, id auctor metus varius rutrum. 56 |

57 |
58 |
59 |

60 | 63 |

64 |
65 |
66 |

67 | 70 |

71 |
72 |
73 |

74 | 77 |

78 |
79 |
80 |

81 | 84 |

85 |
86 |
87 | 118 | 138 | 164 | 190 |
191 | 192 | 193 | 194 | 208 | 209 | 210 | 211 | --------------------------------------------------------------------------------