fortitude-sass 0.6.5 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +12 -0
  3. data/.gitignore +3 -1
  4. data/.ruby-version +1 -1
  5. data/Gruntfile.js +73 -38
  6. data/app/assets/javascripts/fortitude/blocks/dropdown.js +44 -0
  7. data/app/assets/javascripts/fortitude/blocks/flashbar.js +24 -0
  8. data/app/assets/javascripts/fortitude/blocks/modal.js +50 -0
  9. data/app/assets/javascripts/fortitude/blocks/navigationbar.js +11 -0
  10. data/app/assets/javascripts/fortitude/blocks/select-input.js +38 -0
  11. data/app/assets/javascripts/fortitude/blocks/shade.js +28 -0
  12. data/app/assets/javascripts/fortitude/blocks/tabs.js +50 -0
  13. data/app/assets/javascripts/fortitude/generic/get-target.js +13 -0
  14. data/app/assets/javascripts/fortitude/generic/measure-scrollbar.js +21 -0
  15. data/app/assets/javascripts/fortitude/{jquery/generic → generic}/screen-lock.js +6 -2
  16. data/app/assets/javascripts/fortitude/generic/transition-with.js +57 -0
  17. data/app/assets/javascripts/fortitude/generic/viewport.js +21 -0
  18. data/app/assets/javascripts/fortitude/generic/wait-for-animation.js +27 -0
  19. data/app/assets/javascripts/fortitude.js +1 -0
  20. data/app/assets/stylesheets/fortitude/api/blocks/_badge.scss +1 -1
  21. data/app/assets/stylesheets/fortitude/api/blocks/_block-list.scss +2 -2
  22. data/app/assets/stylesheets/fortitude/api/blocks/_button.scss +1 -1
  23. data/app/assets/stylesheets/fortitude/api/blocks/_dropdown.scss +45 -0
  24. data/app/assets/stylesheets/fortitude/api/blocks/_flag.scss +2 -2
  25. data/app/assets/stylesheets/fortitude/api/blocks/_flashbar.scss +11 -1
  26. data/app/assets/stylesheets/fortitude/api/blocks/_input.scss +5 -2
  27. data/app/assets/stylesheets/fortitude/api/blocks/_layout.scss +2 -2
  28. data/app/assets/stylesheets/fortitude/api/blocks/_media.scss +2 -2
  29. data/app/assets/stylesheets/fortitude/api/blocks/_modal.scss +28 -0
  30. data/app/assets/stylesheets/fortitude/api/blocks/_navigationbar.scss +1 -0
  31. data/app/assets/stylesheets/fortitude/api/blocks/_shade.scss +11 -1
  32. data/app/assets/stylesheets/fortitude/api/blocks/_table.scss +5 -0
  33. data/app/assets/stylesheets/fortitude/api/blocks/_tabs-navigation.scss +3 -0
  34. data/app/assets/stylesheets/fortitude/api/blocks/_text.scss +3 -0
  35. data/app/assets/stylesheets/fortitude/api/blocks/_ui-list.scss +2 -2
  36. data/app/assets/stylesheets/fortitude/base/_hr.scss +2 -2
  37. data/app/assets/stylesheets/fortitude/base/_page.scss +0 -2
  38. data/app/assets/stylesheets/fortitude/blocks/_badge.scss +2 -0
  39. data/app/assets/stylesheets/fortitude/blocks/_bare-list.scss +2 -0
  40. data/app/assets/stylesheets/fortitude/blocks/_block-list.scss +2 -0
  41. data/app/assets/stylesheets/fortitude/blocks/_box.scss +2 -0
  42. data/app/assets/stylesheets/fortitude/blocks/_button.scss +2 -0
  43. data/app/assets/stylesheets/fortitude/blocks/_container.scss +2 -0
  44. data/app/assets/stylesheets/fortitude/blocks/_dropdown.scss +15 -0
  45. data/app/assets/stylesheets/fortitude/blocks/_flag.scss +2 -0
  46. data/app/assets/stylesheets/fortitude/blocks/_flashbar.scss +6 -0
  47. data/app/assets/stylesheets/fortitude/blocks/_fluid-container.scss +2 -0
  48. data/app/assets/stylesheets/fortitude/blocks/_inline-list.scss +2 -0
  49. data/app/assets/stylesheets/fortitude/blocks/_input.scss +2 -0
  50. data/app/assets/stylesheets/fortitude/blocks/_layout.scss +2 -0
  51. data/app/assets/stylesheets/fortitude/blocks/_list-navigation.scss +2 -0
  52. data/app/assets/stylesheets/fortitude/blocks/_media.scss +2 -0
  53. data/app/assets/stylesheets/fortitude/blocks/_modal.scss +8 -16
  54. data/app/assets/stylesheets/fortitude/blocks/_navigationbar.scss +5 -2
  55. data/app/assets/stylesheets/fortitude/blocks/_shade.scss +7 -0
  56. data/app/assets/stylesheets/fortitude/blocks/_table.scss +1 -6
  57. data/app/assets/stylesheets/fortitude/blocks/_tabs-navigation.scss +6 -0
  58. data/app/assets/stylesheets/fortitude/blocks/_tabs.scss +2 -0
  59. data/app/assets/stylesheets/fortitude/blocks/_text.scss +1 -3
  60. data/app/assets/stylesheets/fortitude/blocks/_tooltip.scss +2 -0
  61. data/app/assets/stylesheets/fortitude/blocks/_ui-list.scss +2 -0
  62. data/app/assets/stylesheets/fortitude/blocks/_wings.scss +3 -1
  63. data/app/assets/stylesheets/fortitude/generic/_normalize.scss +52 -15
  64. data/app/assets/stylesheets/fortitude/settings/_defaults.scss +1 -0
  65. data/app/assets/stylesheets/fortitude/theme/base/_page.scss +21 -0
  66. data/app/assets/stylesheets/fortitude/theme/extensions/_badge.scss +11 -0
  67. data/app/assets/stylesheets/fortitude/theme/extensions/_box.scss +11 -0
  68. data/app/assets/stylesheets/fortitude/theme/extensions/_button.scss +25 -0
  69. data/app/assets/stylesheets/fortitude/theme/extensions/_flashbar.scss +15 -0
  70. data/app/assets/stylesheets/fortitude/theme/extensions/_navigationbar.scss +51 -0
  71. data/app/assets/stylesheets/fortitude/theme/extensions/_wings.scss +15 -0
  72. data/app/assets/stylesheets/fortitude/theme/settings/_colors.scss +309 -0
  73. data/app/assets/stylesheets/fortitude/theme.scss +9 -0
  74. data/app/assets/stylesheets/fortitude/tools/_functions.scss +22 -13
  75. data/app/assets/stylesheets/fortitude/tools/_mixins.scss +10 -3
  76. data/app/assets/stylesheets/fortitude/trumps/_responsive-column.scss +1 -1
  77. data/app/assets/stylesheets/fortitude/trumps/_responsive-line-height.scss +1 -1
  78. data/app/assets/stylesheets/fortitude/trumps/_responsive-margin.scss +3 -3
  79. data/app/assets/stylesheets/fortitude/trumps/_responsive-padding.scss +1 -1
  80. data/app/assets/stylesheets/fortitude.scss +2 -0
  81. data/bower.json +1 -1
  82. data/jasmine/fixtures/animations.css +85 -0
  83. data/jasmine/fixtures/dropdownFixture.html +91 -0
  84. data/jasmine/fixtures/flashbarFixture.html +6 -0
  85. data/jasmine/fixtures/getTargetFixture.html +11 -0
  86. data/jasmine/fixtures/measureScrollBarFixture.html +1 -0
  87. data/jasmine/fixtures/modalFixture.html +20 -0
  88. data/jasmine/fixtures/navigationbarFixture.html +20 -0
  89. data/jasmine/fixtures/selectInputFixture.html +13 -0
  90. data/jasmine/fixtures/shadeFixture.html +2 -0
  91. data/jasmine/fixtures/tabsFixture.html +22 -0
  92. data/jasmine/fixtures/transitionWithFixture.html +6 -0
  93. data/jasmine/fixtures/viewportFixture.html +2 -0
  94. data/jasmine/fixtures/waitForAnimationFixture.html +1 -0
  95. data/jasmine/helpers/fixtureHelper.js +4 -0
  96. data/jasmine/helpers/multiCallbackHelper.js +24 -0
  97. data/jasmine/specs/blocks/dropdownSpec.js +106 -0
  98. data/jasmine/specs/blocks/flashbarSpec.js +22 -0
  99. data/jasmine/specs/blocks/modalSpec.js +66 -0
  100. data/jasmine/specs/blocks/navigationbarSpec.js +34 -0
  101. data/jasmine/specs/blocks/selectInputSpec.js +31 -0
  102. data/jasmine/specs/blocks/shadeSpec.js +38 -0
  103. data/jasmine/specs/blocks/tabsSpec.js +63 -0
  104. data/jasmine/specs/generic/getTargetSpec.js +28 -0
  105. data/jasmine/specs/generic/measureScrollbarSpec.js +19 -0
  106. data/jasmine/specs/generic/screenLockSpec.js +32 -0
  107. data/jasmine/specs/generic/transitionWithSpec.js +82 -0
  108. data/jasmine/specs/generic/viewportSpec.js +32 -0
  109. data/jasmine/specs/generic/waitForAnimationSpec.js +35 -0
  110. data/jasmine/template.tmpl +2 -0
  111. data/lib/fortitude-sass/version.rb +1 -1
  112. data/package.json +8 -2
  113. data/sass_specs/blocks/_shade_spec.scss +11 -0
  114. data/sass_specs/tests.scss +1 -0
  115. data/sass_specs/tools/_functions_spec.scss +42 -12
  116. metadata +59 -16
  117. data/app/assets/javascripts/fortitude/jquery/blocks/flashbar.js +0 -13
  118. data/app/assets/javascripts/fortitude/jquery/blocks/select-input.js +0 -26
  119. data/app/assets/javascripts/fortitude/jquery/blocks/shade.js +0 -36
  120. data/app/assets/javascripts/fortitude/jquery/generic/measure-scrollbar.js +0 -13
  121. data/app/assets/javascripts/fortitude/jquery/generic/viewport.js +0 -9
  122. data/app/assets/javascripts/fortitude/jquery/generic/wait-for-animation.js +0 -103
  123. data/app/assets/javascripts/fortitude/jquery/index.js +0 -3
  124. data/app/assets/javascripts/fortitude.jquery.js +0 -45
  125. data/dist/fortitude-theme.css +0 -9236
  126. data/dist/fortitude.css +0 -8976
  127. data/dist/fortitude.jquery.js +0 -1
  128. data/dist/fortitude.min.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 605ddd17d2777b46f86fab2f02babd34c00e2529
4
- data.tar.gz: 72e6958647ce04e470e865215850a4b040fea60f
3
+ metadata.gz: 01804f33d10f467bd2636d4f0482780331b7a28c
4
+ data.tar.gz: f2e1c193938b2152ccccd5e6026682cfc30c730d
5
5
  SHA512:
6
- metadata.gz: c639fc4b472111029569b4501c3ef2ae7e2370720e194679aefad9ab3205fc74f8093cd05c175a5f8d0f1aacbd9dc234c179e4905025630578122f0c8c3de221
7
- data.tar.gz: 86ffdbe2152a493c165123cf38816a186f0f0334b3901725dd251c010fcd145839112503da53b50c59cffc9ef798f463736b417dfb030444de785a9471a3af04
6
+ metadata.gz: e39500c34d590970983008cdb3877f706f2648744431705e01951ad9442536da2d87b59c463f5bdc6ded181a38e87941d5374d76a775da14b6df18d0ab63aa59
7
+ data.tar.gz: 2e5f23ff6a2e98b591f499537145a64bffd0e2a3d9afdd469b44642ced9c69bef706095eb7f8097a1998e7b05d7e58f6c16f0925decf5001a3e5bcf44da8c961
data/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ # EditorConfig is awesome: http://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ # Global Project Settings
7
+ [*]
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+ indent_style = space
12
+ indent_size = 2
data/.gitignore CHANGED
@@ -7,4 +7,6 @@ tags
7
7
  .idea
8
8
  *results.css
9
9
  bower_components
10
- node_modules
10
+ node_modules
11
+ dist
12
+ .grunt/
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.4
1
+ 2.1.5
data/Gruntfile.js CHANGED
@@ -2,14 +2,15 @@ module.exports = function(grunt) {
2
2
 
3
3
  grunt.initConfig({
4
4
  pkg: grunt.file.readJSON('package.json'),
5
-
5
+
6
6
  app: {
7
7
  scss: 'app/assets/stylesheets',
8
8
  js: 'app/assets/javascripts',
9
9
  img: 'app/assets/images',
10
10
  dist: 'dist',
11
11
  tmp: 'tmp',
12
- sass_specs: 'sass_specs'
12
+ sass_specs: 'sass_specs',
13
+ jasmine: 'jasmine'
13
14
  },
14
15
 
15
16
  bower: {
@@ -22,47 +23,63 @@ module.exports = function(grunt) {
22
23
  cwd: '<%= app.img %>',
23
24
  src: '**/*.png',
24
25
  dest: '<%= app.dist %>/'
26
+ },
27
+ test: {
28
+ expand: true,
29
+ cwd: '<%= app.jasmine %>',
30
+ src: '**/*.html',
31
+ dest: '<%= app.tmp %>'
25
32
  }
26
33
  },
27
-
34
+
28
35
  sass: {
29
36
  dist: {
37
+ options: {
38
+ style: 'compact',
39
+ bundleExec: true,
40
+ sourcemap: 'none'
41
+ },
42
+ files: {
43
+ '<%= app.dist %>/<%= pkg.name %>.css': '<%= app.scss %>/fortitude.scss',
44
+ '<%= app.dist %>/<%= pkg.name %>-theme.css': '<%= app.scss %>/fortitude/theme.scss'
45
+ },
46
+ },
47
+ min: {
30
48
  options: {
31
49
  style: 'compressed',
32
50
  bundleExec: true,
33
51
  sourcemap: 'none'
34
52
  },
35
53
  files: {
36
- '<%= app.tmp %>/<%= pkg.name %>.css.min': '<%= app.scss %>/fortitude.scss',
37
- '<%= app.tmp %>/<%= pkg.name %>-theme.css.min': '<%= app.scss %>/fortitude/theme.scss'
54
+ '<%= app.dist %>/<%= pkg.name %>.min.css': '<%= app.scss %>/fortitude.scss',
55
+ '<%= app.dist %>/<%= pkg.name %>-theme.min.css': '<%= app.scss %>/fortitude/theme.scss'
38
56
  }
39
57
  },
40
58
  test: {
41
59
  options: {
42
- style: 'expanded',
60
+ style: 'compact',
43
61
  loadPath: [
44
- '<%= app.scss %>',
45
- 'node_modules/bootcamp/dist'
62
+ '<%= app.scss %>',
63
+ 'node_modules/bootcamp/dist'
46
64
  ],
47
65
  bundleExec: true,
48
66
  sourcemap: 'none'
49
67
  },
50
68
  files: {
51
69
  '<%= app.tmp %>/results.css': '<%= app.sass_specs %>/tests.scss',
52
- '<%= app.tmp %>/<%= pkg.name %>.css': '<%= app.scss %>/fortitude.scss',
53
- '<%= app.tmp %>/<%= pkg.name %>-theme.css': '<%= app.scss %>/fortitude/theme.scss'
70
+ '<%= app.tmp %>/<%= pkg.name %>.css': '<%= app.scss %>/fortitude.scss'
54
71
  }
55
72
  }
56
73
  },
57
74
 
58
75
  autoprefixer: {
59
76
  options: {
60
- browsers: ['last 2 versions', 'ie 8', 'ie 9']
77
+ browsers: ['last 2 versions', 'ie 9']
61
78
  },
62
79
  dist: {
63
80
  expand: true,
64
81
  flatten: true,
65
- src: '<%= app.tmp %>/*.css',
82
+ src: '<%= app.dist %>/*.css',
66
83
  dest: '<%= app.dist %>/'
67
84
  },
68
85
  test: {
@@ -76,26 +93,22 @@ module.exports = function(grunt) {
76
93
  csslint: {
77
94
  test: {
78
95
  options: {
79
- 'import': 2,
80
- 'ids': false,
81
- 'zero-units': false,
82
- 'fallback-colors': false,
96
+ 'adjoining-classes': false,
97
+ 'box-model': false,
83
98
  'box-sizing': false,
84
- 'vendor-prefixes': false,
85
99
  'compatible-vendor-prefixes': false,
86
- 'universal-selector': false,
87
- 'box-model': false,
88
- 'adjoining-classes': false,
89
- 'unique-headings': false,
90
- 'unqualified-attributes': false,
91
- 'font-sizes': false,
92
- 'overqualified-elements': false,
93
- 'font-sizes': false,
100
+ 'fallback-colors': false,
94
101
  'floats': false,
102
+ 'font-sizes': false,
103
+ 'important': false,
104
+ 'known-properties': false,
95
105
  'outline-none': false,
96
- 'known-properties': false
106
+ 'overqualified-elements': false,
107
+ 'unique-headings': false,
108
+ 'universal-selector': false,
109
+ 'unqualified-attributes': false
97
110
  },
98
- src: ['<%= app.tmp %>/<%= pkg.name %>.css', '<%= app.tmp %>/<%= pkg.name %>-theme.css']
111
+ src: ['<%= app.tmp %>/<%= pkg.name %>.css']
99
112
  }
100
113
  },
101
114
 
@@ -110,11 +123,11 @@ module.exports = function(grunt) {
110
123
  concat: {
111
124
  dist: {
112
125
  src: ['<%= app.js %>/**/*.js'],
113
- dest: '<%= app.tmp %>/<%= pkg.name %>.js',
126
+ dest: '<%= app.dist %>/<%= pkg.name %>.js',
114
127
  },
115
128
  test: {
116
129
  src: ['<%= app.js %>/**/*.js'],
117
- dest: '<%= app.tmp %>/<%= pkg.name %>.js',
130
+ dest: '<%= app.tmp %>/<%= pkg.name %>.js',
118
131
  }
119
132
  },
120
133
 
@@ -133,15 +146,36 @@ module.exports = function(grunt) {
133
146
 
134
147
  jshint: {
135
148
  all: ['<%= app.js %>/**/*.js'],
136
- test: ['<%= app.tmp %>/<%= pkg.name %>.js']
149
+ test: ['<%= app.tmp %>/<%= pkg.name %>.js', '<%= app.jasmine %>/**/*.js']
150
+ },
151
+
152
+ jasmine: {
153
+ fortitude: {
154
+ src: 'app/assets/javascripts/**/*.js',
155
+ options: {
156
+ specs: '<%= app.jasmine %>/**/*Spec.js',
157
+ helpers: '<%= app.jasmine %>/**/*Helper.js',
158
+ styles: [
159
+ '<%= app.tmp %>/<%= pkg.name %>.css',
160
+ '<%= app.jasmine %>/fixtures/animations.css'
161
+ ],
162
+ vendor: [
163
+ 'node_modules/jquery/dist/jquery.js',
164
+ 'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
165
+ 'node_modules/lodash/index.js'
166
+ ],
167
+ outfile: '<%= app.tmp %>/SpecRunner.html',
168
+ keepRunner: true
169
+ }
170
+ }
137
171
  },
138
172
 
139
173
  clean: ['tmp']
140
174
  });
141
175
 
142
- grunt.loadNpmTasks('grunt-bower-task');
143
- grunt.loadNpmTasks('grunt-contrib-clean');
144
- grunt.loadNpmTasks('grunt-contrib-copy');
176
+ grunt.loadNpmTasks('grunt-bower-task');
177
+ grunt.loadNpmTasks('grunt-contrib-clean');
178
+ grunt.loadNpmTasks('grunt-contrib-copy');
145
179
 
146
180
  // Sass resources
147
181
  grunt.loadNpmTasks('grunt-contrib-sass');
@@ -153,15 +187,16 @@ module.exports = function(grunt) {
153
187
  grunt.loadNpmTasks('grunt-contrib-concat');
154
188
  grunt.loadNpmTasks('grunt-contrib-uglify');
155
189
  grunt.loadNpmTasks('grunt-contrib-jshint');
190
+ grunt.loadNpmTasks('grunt-contrib-jasmine');
156
191
 
157
192
  grunt.registerTask('setup', ['bower']);
158
- grunt.registerTask('test-css', ['sass:test', 'autoprefixer:test', 'bootcamp:test', 'csslint:test']);
159
- grunt.registerTask('test-js', ['jshint:all', 'concat:test', 'jshint:test', 'uglify:test']);
193
+ grunt.registerTask('test-css', ['build:test', 'bootcamp:test', 'csslint:test']);
194
+ grunt.registerTask('test-js', ['build:test', 'jshint:all', 'concat:test', 'jshint:test', 'uglify:test', 'jasmine']);
160
195
 
161
196
  grunt.registerTask('test', ['test-css', 'test-js', 'clean']);
162
- grunt.registerTask('build', ['sass:dist', 'autoprefixer:dist', 'concat:dist', 'uglify:dist', 'copy:dist']);
197
+ grunt.registerTask('build:test', ['sass:test', 'autoprefixer:test', 'copy:test']);
198
+ grunt.registerTask('build', ['sass:dist', 'sass:min', 'autoprefixer:dist', 'concat:dist', 'uglify:dist', 'copy:dist']);
163
199
 
164
200
  grunt.registerTask('default', ['test']);
165
201
 
166
-
167
- };
202
+ };
@@ -0,0 +1,44 @@
1
+ (function($){
2
+ 'use strict';
3
+
4
+ $(document).on('open.ft.dropdown', '.dropdown', function(event){
5
+ var $dropdown = $(this),
6
+ dropdownIdentifier = $dropdown.data('ftDropdown');
7
+
8
+ $dropdown.ftTransitionWith({
9
+ dataAttr: 'ftShowClass',
10
+ endEvent: 'opened.ft.dropdown'
11
+ }).then(function(){
12
+ $dropdown.prop('checked', true);
13
+ });
14
+
15
+ if(dropdownIdentifier){
16
+ $('[data-ft-dropdown="' + dropdownIdentifier + '"]').each(function(){
17
+ var $element = $(this);
18
+ if(!$element.is($dropdown)){
19
+ $element.trigger('close.ft.dropdown');
20
+ }
21
+ });
22
+ }
23
+ });
24
+
25
+ $(document).on('close.ft.dropdown', '.dropdown', function(event){
26
+ $(this).ftTransitionWith({
27
+ dataAttr: 'ftHideClass'
28
+ }).then(function(){
29
+ $(this).find('.dropdown__toggle').prop('checked', false);
30
+ $(this).trigger('closed.ft.dropdown');
31
+ });
32
+ });
33
+
34
+ $(document).on('change', '.dropdown > .dropdown__toggle', function(event){
35
+ var $this = $(this);
36
+ if($this.is(':checked')){
37
+ $(this).closest('.dropdown').trigger('open.ft.dropdown');
38
+ } else {
39
+ $(this).closest('.dropdown').trigger('close.ft.dropdown');
40
+ }
41
+
42
+ });
43
+
44
+ })(jQuery);
@@ -0,0 +1,24 @@
1
+ (function($) {
2
+ 'use strict';
3
+
4
+ $(document).on('close.ft.flashbar', '.flashbar', function(event) {
5
+ $(this).ftTransitionWith({
6
+ dataAttr: 'ftHideClass',
7
+ addClass: 'flashbar--closed',
8
+ endEvent: 'closed.ft.flashbar'
9
+ });
10
+ });
11
+
12
+ $(document).on('open.ft.flashbar', '.flashbar', function(event){
13
+ $(this).ftTransitionWith({
14
+ dataAttr: 'ftShowClass',
15
+ removeClass: 'flashbar--closed',
16
+ endEvent: 'opened.ft.flashbar'
17
+ });
18
+ });
19
+
20
+ $(document).on('click', '.flashbar__close', function(event){
21
+ $(this).closest('.flashbar').trigger('close.ft.flashbar');
22
+ });
23
+
24
+ })(jQuery);
@@ -0,0 +1,50 @@
1
+ (function($) {
2
+ 'use strict';
3
+
4
+ $(document).on('open.ft.modal', '.modal', function(event) {
5
+ var $this = $(this);
6
+
7
+ $.screenLock(true);
8
+ $('.shade').trigger('open.ft.shade');
9
+ $('.container--fixed-top').css({
10
+ paddingRight: $.measureScrollBar()
11
+ });
12
+
13
+ $this.ftTransitionWith({
14
+ dataAttr: 'ftShowClass',
15
+ addClass: 'modal--is-active',
16
+ endEvent: 'opened.ft.modal'
17
+ });
18
+ });
19
+
20
+ $(document).on('close.ft.modal', '.modal', function(event) {
21
+ var $this = $(this);
22
+
23
+ $.screenLock(false);
24
+ $('.shade').trigger('close.ft.shade');
25
+ $('.container--fixed-top').css({
26
+ paddingRight: $.measureScrollBar()
27
+ });
28
+
29
+ $this.ftTransitionWith({
30
+ dataAttr: 'ftHideClass',
31
+ removeClass: 'modal--is-active',
32
+ endEvent: 'closed.ft.modal'
33
+ });
34
+ });
35
+
36
+ $(document).on('click', '[data-ft-modal]', function(){
37
+ var $target = $.ftGetTarget($(this), 'ftModal');
38
+ $target.trigger('open.ft.modal');
39
+ });
40
+
41
+ $(document).on('click', '[data-ft-modal-close]', function(){
42
+ var $target = $.ftGetTarget($(this), 'ftModalClose');
43
+ $target.trigger('close.ft.modal');
44
+ });
45
+
46
+ $(document).on('click', '.shade', function(){
47
+ $('.modal--is-active').trigger('close.ft.modal');
48
+ });
49
+
50
+ })(jQuery);
@@ -0,0 +1,11 @@
1
+ (function($) {
2
+ 'use strict';
3
+
4
+ $(document).on('change', '.navigationbar__toggle__helper', function(){
5
+ if($(this).prop('checked')){
6
+ $('.shade').trigger('open.ft.shade');
7
+ } else {
8
+ $('.shade').trigger('close.ft.shade');
9
+ }
10
+ });
11
+ })(jQuery);
@@ -0,0 +1,38 @@
1
+ (function($) {
2
+ 'use strict';
3
+
4
+ var $document = $(document);
5
+
6
+ var setClassName = function() {
7
+ var $this = $(this),
8
+ className = $this.find(':selected').attr('class') || "",
9
+ data = $this.data('ftSelect') || {};
10
+
11
+ if (className !== data.previousClass) {
12
+ $this
13
+ .addClass(className)
14
+ .removeClass(data.previousClass)
15
+ .data('ftSelect', $.merge({previousClass: className}, data));
16
+ }
17
+ };
18
+
19
+ var setupSelectInputs = function(){
20
+ $document
21
+ .find('.select-input')
22
+ .data('ftSelect', {previousClass: ""})
23
+ .each(setClassName);
24
+ };
25
+
26
+ $document.on('change.ft.select', 'select:not([multiple])', setClassName);
27
+
28
+ $document.on('DOMContentLoaded', function() {
29
+ setupSelectInputs();
30
+ });
31
+
32
+ $document.on('setup.ft.select', function(){
33
+ setupSelectInputs();
34
+ });
35
+
36
+ setTimeout(setupSelectInputs, 0);
37
+
38
+ })(jQuery);
@@ -0,0 +1,28 @@
1
+ (function($) {
2
+ 'use strict';
3
+
4
+ $(document).on('open.ft.shade', '.shade', function(event) {
5
+ $(this).ftTransitionWith({
6
+ dataAttr: 'ftShowClass',
7
+ addClass: 'shade--is-active',
8
+ endEvent: 'opened.ft.shade'
9
+ });
10
+ });
11
+
12
+ $(document).on('close.ft.shade', '.shade', function(event) {
13
+ $(this).ftTransitionWith({
14
+ dataAttr: 'ftHideClass',
15
+ removeClass: 'shade--is-active',
16
+ endEvent: 'closed.ft.shade'
17
+ });
18
+ });
19
+
20
+ $(document).on('click', '.shade', function(event) {
21
+ $(this).trigger('close.ft.shade');
22
+ });
23
+
24
+ $(document).on('click', '[data-ft-shade]', function(event) {
25
+ $('.shade').trigger('open.ft.shade');
26
+ });
27
+
28
+ })(jQuery);