diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-03-02 02:02:01 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-03-04 01:47:38 +0300 |
commit | 7371f6cd8c168df41e4197f80f53f3c04185dee7 (patch) | |
tree | 5eaf634bd30bf984df0611470bc4e268f2ae9b7c /app/assets/javascripts/commons | |
parent | cb6c036d8942ab24048b9ecebcc6c3fa408c9a3e (diff) |
refactor common bundle to ES module syntax and move global exports to application.js
Diffstat (limited to 'app/assets/javascripts/commons')
-rw-r--r-- | app/assets/javascripts/commons/bootstrap.js | 18 | ||||
-rw-r--r-- | app/assets/javascripts/commons/index.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/commons/jquery.js | 21 |
3 files changed, 21 insertions, 22 deletions
diff --git a/app/assets/javascripts/commons/bootstrap.js b/app/assets/javascripts/commons/bootstrap.js index 72e43d34a74..db0cbfd87c3 100644 --- a/app/assets/javascripts/commons/bootstrap.js +++ b/app/assets/javascripts/commons/bootstrap.js @@ -1,10 +1,10 @@ -require('./jquery'); +import 'jquery'; -// twitter bootstrap plugins -require('bootstrap-sass/assets/javascripts/bootstrap/affix'); -require('bootstrap-sass/assets/javascripts/bootstrap/alert'); -require('bootstrap-sass/assets/javascripts/bootstrap/dropdown'); -require('bootstrap-sass/assets/javascripts/bootstrap/modal'); -require('bootstrap-sass/assets/javascripts/bootstrap/tab'); -require('bootstrap-sass/assets/javascripts/bootstrap/transition'); -require('bootstrap-sass/assets/javascripts/bootstrap/tooltip'); +// bootstrap jQuery plugins +import 'bootstrap-sass/assets/javascripts/bootstrap/affix'; +import 'bootstrap-sass/assets/javascripts/bootstrap/alert'; +import 'bootstrap-sass/assets/javascripts/bootstrap/dropdown'; +import 'bootstrap-sass/assets/javascripts/bootstrap/modal'; +import 'bootstrap-sass/assets/javascripts/bootstrap/tab'; +import 'bootstrap-sass/assets/javascripts/bootstrap/transition'; +import 'bootstrap-sass/assets/javascripts/bootstrap/tooltip'; diff --git a/app/assets/javascripts/commons/index.js b/app/assets/javascripts/commons/index.js index a9226bc1325..72ede1d621a 100644 --- a/app/assets/javascripts/commons/index.js +++ b/app/assets/javascripts/commons/index.js @@ -1,2 +1,2 @@ -require('./jquery'); -require('./bootstrap'); +import './jquery'; +import './bootstrap'; diff --git a/app/assets/javascripts/commons/jquery.js b/app/assets/javascripts/commons/jquery.js index 9ef415d6a95..b53f6284afc 100644 --- a/app/assets/javascripts/commons/jquery.js +++ b/app/assets/javascripts/commons/jquery.js @@ -1,12 +1,11 @@ -// jQuery library -window.$ = window.jQuery = require('jquery'); +import 'jquery'; -// jQuery plugins -require('jquery-ujs'); -require('vendor/jquery.endless-scroll'); -require('vendor/jquery.caret'); -require('vendor/jquery.atwho'); -require('vendor/jquery.scrollTo'); -require('vendor/jquery.nicescroll'); -require('vendor/jquery.waitforimages'); -require('select2/select2.js'); +// common jQuery plugins +import 'jquery-ujs'; +import 'vendor/jquery.endless-scroll'; +import 'vendor/jquery.caret'; +import 'vendor/jquery.atwho'; +import 'vendor/jquery.scrollTo'; +import 'vendor/jquery.nicescroll'; +import 'vendor/jquery.waitforimages'; +import 'select2/select2'; |