Custom Search

Tuesday, March 25, 2014

OpenStack Horizon How to Prevent popup from closing when you click outside popup

1)
There are two files

horizon/static/bootstrap/js/bootstrap.js <=== for dev
https://github.com/openstack/horizon/blob/6954c02f4dc1d3ee98c56cc2a53512b4b625478a/horizon/static/bootstrap/js/bootstrap.js
and
horizon/static/bootstrap/js/bootstrap.min.js <=== for production (compressed)
https://github.com/openstack/horizon/blob/6954c02f4dc1d3ee98c56cc2a53512b4b625478a/horizon/static/bootstrap/js/bootstrap.min.js

bootstrap.js is not included in any html file
bootstrap.min.js is included in horizon/templates/horizon/_scripts.html

2)
http://getbootstrap.com/javascript/

Make following changes in bootstrap.js

Change

  $.fn.modal.defaults = {
      backdrop: true
    , keyboard: true
    , show: true
  }

To

  $.fn.modal.defaults = {
      backdrop: 'static'
    , keyboard: true
    , show: true
  } 

3)
http://jscompress.com/
http://stackoverflow.com/questions/9123112/twitter-bootstrap-make-from-source

* Compress the modified bootstrap.js and create bootstrap.min.js
* From the "makefile", find which compression tool was used to create bootstrap.min.js : https://github.com/twbs/bootstrap/

#sudo apt-get install node-uglify
*Modify bootstrap.js (Step-2) and run following command to create a compressed bootstrap.min.js file

#uglifyjs horizon/static/bootstrap/js/bootstrap.js -o horizon/static/bootstrap/js/bootstrap.min.js
* Run "#git diff" or check bootstrap.min.js and ensure that has Changes.

4)
Commit following files
horizon/static/bootstrap/js/bootstrap.js
horizon/static/bootstrap/js/bootstrap.min.js

=======Ref========

#sudo apt-get install yui-compressor
#yui-compressor horizon/static/bootstrap/js/bootstrap.js -o horizon/static/bootstrap/js/bootstrap.min.js

No comments:

Post a Comment