pageflow 15.2.2 → 15.6.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pageflow might be problematic. Click here for more details.

Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -118
  3. data/README.md +2 -3
  4. data/admins/pageflow/accounts.rb +1 -98
  5. data/admins/pageflow/entry.rb +21 -1
  6. data/admins/pageflow/entry_templates.rb +140 -0
  7. data/admins/pageflow/membership.rb +12 -0
  8. data/admins/pageflow/user.rb +5 -5
  9. data/app/assets/javascripts/pageflow/admin/entries.js +65 -0
  10. data/app/assets/javascripts/pageflow/admin/users.js +1 -1
  11. data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -0
  12. data/app/assets/javascripts/pageflow/base.js +0 -12
  13. data/app/assets/javascripts/pageflow/components.js +2 -6
  14. data/app/assets/javascripts/pageflow/dist/ui.js +178 -55
  15. data/app/assets/javascripts/pageflow/editor/vendor.js +1 -0
  16. data/app/assets/javascripts/pageflow/vendor.js +12 -10
  17. data/app/assets/stylesheets/pageflow/base.scss +0 -7
  18. data/app/assets/stylesheets/pageflow/editor/base.scss +5 -2
  19. data/app/assets/stylesheets/pageflow/editor/composables.scss +5 -1
  20. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +1 -1
  21. data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +44 -55
  22. data/app/assets/stylesheets/pageflow/editor/help.scss +2 -2
  23. data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
  24. data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -1
  25. data/app/assets/stylesheets/pageflow/entries.scss +1 -1
  26. data/app/assets/stylesheets/pageflow/loading_spinner.scss +4 -1
  27. data/app/assets/stylesheets/pageflow/navigation_mobile.scss +4 -4
  28. data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +1 -1
  29. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +1 -1
  30. data/app/assets/stylesheets/pageflow/themes/default/page.scss +7 -0
  31. data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +1 -1
  32. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +1 -1
  33. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +1 -1
  34. data/app/assets/stylesheets/pageflow/themes/default/player_controls/shared/menu_bar.scss +2 -2
  35. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/control_bar.scss +2 -2
  36. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +1 -1
  37. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/quality_menu.scss +2 -2
  38. data/app/assets/stylesheets/pageflow/themes/default/player_controls/waveform/wave.scss +1 -1
  39. data/app/assets/stylesheets/pageflow/ui/forms.scss +9 -2
  40. data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +2 -2
  41. data/app/assets/stylesheets/pageflow/ui/tooltip.scss +17 -3
  42. data/app/helpers/pageflow/admin/entries_helper.rb +16 -0
  43. data/app/helpers/pageflow/structured_data_helper.rb +0 -2
  44. data/app/models/pageflow/account.rb +21 -1
  45. data/app/models/pageflow/account_role_query.rb +1 -1
  46. data/app/models/pageflow/chapter.rb +3 -9
  47. data/app/models/pageflow/entry.rb +9 -2
  48. data/app/models/pageflow/entry_duplicate.rb +1 -0
  49. data/app/models/pageflow/entry_template.rb +16 -2
  50. data/app/models/pageflow/managed_user_query.rb +1 -1
  51. data/app/models/pageflow/page.rb +1 -4
  52. data/app/models/pageflow/revision.rb +0 -4
  53. data/app/models/pageflow/storyline.rb +2 -9
  54. data/app/policies/pageflow/account_policy.rb +10 -0
  55. data/app/policies/pageflow/entry_template_policy.rb +5 -1
  56. data/app/policies/pageflow/folder_policy.rb +2 -2
  57. data/app/policies/pageflow/membership_policy.rb +2 -2
  58. data/app/policies/pageflow/theming_policy.rb +2 -2
  59. data/app/policies/pageflow/user_policy.rb +1 -1
  60. data/app/views/admin/accounts/_entry_template_details.html.arb +7 -5
  61. data/app/views/admin/accounts/_form.html.erb +3 -49
  62. data/app/views/admin/entries/_attributes_table.html.arb +5 -0
  63. data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +2 -0
  64. data/app/views/admin/entries/entry_types.json.jbuilder +4 -0
  65. data/app/views/admin/entry_templates/_form.html.erb +58 -0
  66. data/app/views/admin/users/_not_allowed_to_see_user_quota.html.erb +3 -0
  67. data/app/views/components/pageflow/admin/entry_templates_tab.rb +48 -0
  68. data/app/views/pageflow/admin/initial_passwords/edit.html.erb +2 -1
  69. data/app/views/pageflow/admin/users/_quota_exhausted.html.erb +1 -1
  70. data/app/views/pageflow/themes/_theme.json.jbuilder +1 -1
  71. data/app/views/pageflow/video_files/_video_file.json.jbuilder +8 -1
  72. data/config/initializers/admin_resource_tabs.rb +5 -0
  73. data/config/initializers/help_entries.rb +1 -5
  74. data/config/initializers/revision_components.rb +5 -0
  75. data/config/locales/de.yml +88 -155
  76. data/config/locales/en.yml +79 -143
  77. data/db/migrate/20200515112500_add_constraints_to_entry_templates.rb +21 -0
  78. data/db/migrate/20200807135200_rename_pageflow_entry_template_entry_type_to_entry_type_name.rb +7 -0
  79. data/entry_types/paged/app/assets/javascripts/pageflow_paged/components.js +7 -0
  80. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +1528 -1349
  81. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +9258 -0
  82. data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-client.js +1 -1
  83. data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-server.js +3 -3
  84. data/entry_types/paged/app/assets/javascripts/pageflow_paged/frontend.js +6 -0
  85. data/entry_types/paged/app/assets/javascripts/pageflow_paged/server_rendering.js +9 -0
  86. data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +9 -0
  87. data/entry_types/paged/app/assets/javascripts/pageflow_paged/videojs.js +6 -0
  88. data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +2 -2
  89. data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/page_background_asset_helper.rb +4 -3
  90. data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/react_server_side_rendering_helper.rb +23 -2
  91. data/entry_types/paged/app/views/layouts/pageflow_paged/_loading_spinner_inline_script.html.erb +1 -0
  92. data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +3 -3
  93. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +4 -2
  94. data/entry_types/paged/app/views/pageflow_paged/entries/_entry.html.erb +1 -1
  95. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/page_background_asset/_element.html.erb +0 -0
  96. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/_widget.html.erb +0 -0
  97. data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/page.html.erb +0 -0
  98. data/entry_types/paged/config/initializers/features.rb +1 -1
  99. data/entry_types/paged/config/initializers/help_entries.rb +17 -0
  100. data/entry_types/paged/config/locales/new/help.de.yml +162 -0
  101. data/entry_types/paged/config/locales/new/help.en.yml +153 -0
  102. data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -0
  103. data/entry_types/paged/lib/pageflow_paged/plugin.rb +5 -1
  104. data/entry_types/paged/lib/pageflow_paged/react.rb +12 -0
  105. data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/page_type.rb +2 -2
  106. data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/widget_type.rb +2 -2
  107. data/entry_types/paged/lib/tasks/pageflow_paged_tasks.rake +7 -0
  108. data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react-server.js +20613 -0
  109. data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react.js +21495 -0
  110. data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/dash.all.min.js +0 -0
  111. data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs-dash.js +0 -0
  112. data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs.js +0 -0
  113. data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react-server.js +24 -0
  114. data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react.js +24 -0
  115. data/entry_types/scrolled/app/assets/javascripts/pageflow_scrolled/legacy.js +0 -0
  116. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
  117. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +14 -4
  118. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
  119. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +10 -0
  120. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +7 -0
  121. data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
  122. data/entry_types/scrolled/app/helpers/pageflow_scrolled/favicon_helper.rb +21 -0
  123. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +40 -0
  124. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +36 -0
  125. data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +3 -9
  126. data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +37 -2
  127. data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +3 -9
  128. data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +1 -9
  129. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/content_elements/batch.json.jbuilder +2 -0
  130. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -7
  131. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/_global_notices.html.erb +10 -0
  132. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +28 -11
  133. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +3 -0
  134. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +8 -0
  135. data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +10 -0
  136. data/entry_types/scrolled/config/initializers/help_entries.rb +16 -0
  137. data/entry_types/scrolled/config/locales/de.yml +669 -0
  138. data/entry_types/scrolled/config/locales/en.yml +488 -0
  139. data/entry_types/scrolled/config/routes.rb +1 -0
  140. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +76 -6
  141. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-192x192.png +0 -0
  142. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-512x512.png +0 -0
  143. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/apple-touch-icon.png +0 -0
  144. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/browserconfig.xml +9 -0
  145. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-16x16.png +0 -0
  146. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-32x32.png +0 -0
  147. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon.ico +0 -0
  148. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/mstile-150x150.png +0 -0
  149. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/safari-pinned-tab.svg +46 -0
  150. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/site.webmanifest +19 -0
  151. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg +56 -0
  152. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg +22 -0
  153. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/unmute.mp3 +0 -0
  154. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +26 -0
  155. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +6 -0
  156. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +3 -1
  157. data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +90 -30
  158. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/create_bundle_symlinks_for_yarn.rake +33 -0
  159. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +8 -0
  160. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +173 -0
  161. data/entry_types/scrolled/package/config/webpack.js +11 -0
  162. data/entry_types/scrolled/package/contentElements-editor.js +316 -185
  163. data/entry_types/scrolled/package/contentElements-frontend.css +1 -0
  164. data/entry_types/scrolled/package/contentElements-frontend.js +940 -304
  165. data/entry_types/scrolled/package/editor.js +2930 -371
  166. data/entry_types/scrolled/package/frontend-server.js +228 -0
  167. data/entry_types/scrolled/package/frontend/EditableText-7093fd0e.js +1071 -0
  168. data/entry_types/scrolled/package/frontend/Viewer-e49e7807.js +387 -0
  169. data/entry_types/scrolled/package/frontend/Wavesurfer-0adf5667.js +375 -0
  170. data/entry_types/scrolled/package/frontend/components-6a6793ca.js +2534 -0
  171. data/entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js +86 -0
  172. data/entry_types/scrolled/package/frontend/i18n-4dc6c377.js +1092 -0
  173. data/entry_types/scrolled/package/frontend/index.css +9 -0
  174. data/entry_types/scrolled/package/frontend/index.js +5686 -0
  175. data/entry_types/scrolled/package/frontend/useBrowserFeature-91a4c29d.js +33 -0
  176. data/entry_types/scrolled/package/package.json +30 -9
  177. data/entry_types/scrolled/spec/fixtures/audio.m4a +0 -0
  178. data/entry_types/scrolled/spec/fixtures/video.mp4 +0 -0
  179. data/lib/generators/pageflow/initializer/templates/pageflow.rb +14 -9
  180. data/lib/pageflow/ability_mixin.rb +14 -2
  181. data/lib/pageflow/configuration.rb +6 -5
  182. data/lib/pageflow/entry_export_import/revision_serialization.rb +15 -13
  183. data/lib/pageflow/entry_export_import/revision_serialization/import.rb +18 -26
  184. data/lib/pageflow/entry_type_configuration.rb +2 -0
  185. data/lib/pageflow/global_config_api.rb +5 -4
  186. data/lib/pageflow/nested_revision_component.rb +49 -0
  187. data/lib/pageflow/react.rb +4 -2
  188. data/lib/pageflow/revision_component.rb +6 -2
  189. data/lib/pageflow/themes.rb +4 -0
  190. data/lib/pageflow/user_mixin.rb +2 -1
  191. data/lib/pageflow/version.rb +1 -1
  192. data/{packages/pageflow → package}/config/jest/index.js +8 -2
  193. data/{packages/pageflow → package}/config/jest/transformers/jst.js +0 -0
  194. data/{packages/pageflow → package}/config/jest/transformers/upwardBabel.js +0 -0
  195. data/{packages/pageflow → package}/config/webpack.js +7 -0
  196. data/{packages/pageflow → package}/editor.js +482 -1130
  197. data/package/frontend.js +2553 -0
  198. data/{packages/pageflow → package}/package.json +3 -0
  199. data/{packages/pageflow → package}/testHelpers.js +114 -13
  200. data/{packages/pageflow → package}/ui.js +178 -55
  201. data/spec/factories/accounts.rb +3 -1
  202. data/spec/factories/entry_templates.rb +1 -0
  203. data/spec/factories/published_entries.rb +6 -1
  204. data/spec/factories/test_revision_components.rb +4 -0
  205. metadata +95 -36
  206. data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
  207. data/app/assets/javascripts/pageflow/videojs.js +0 -6
  208. data/config/initializers/entry_types.rb +0 -4
  209. data/entry_types/scrolled/config/locales/new/de.yml +0 -269
  210. data/entry_types/scrolled/config/locales/new/en.yml +0 -264
  211. data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +0 -96
  212. data/entry_types/scrolled/package/frontend.js +0 -2879
  213. data/packages/pageflow/config/jest/transformers/cssModules.js +0 -1
@@ -64,6 +64,18 @@ module Pageflow
64
64
  end)
65
65
 
66
66
  controller do
67
+ # We put the `belongs_to` call in the controller block to work
68
+ # around the issue that ActiveAdmin does not yet support
69
+ # polymorphic nested resources [1]. This works since the
70
+ # underlying InheritedResources library does support polymorphic
71
+ # nesting [2]. As mentioned in the ActiveAdmin issue, we need to
72
+ # set up routes manually then, though. This is done in
73
+ # `Pageflow.routes` [3].
74
+ #
75
+ # [1] activeadmin/activeadmin#221
76
+ # [2] https://github.com/activeadmin/inherited_resources#polymorphic-belongs-to
77
+ # [3] https://github.com/codevise/pageflow/blob/023fdb7c5b3b917bb94f4adafa18a31f8bd9c753/lib/pageflow.rb#L10
78
+
67
79
  belongs_to :entry, parent_class: Pageflow::Entry, polymorphic: true
68
80
  belongs_to :account, parent_class: Pageflow::Account, polymorphic: true
69
81
  belongs_to :user, parent_class: User, polymorphic: true
@@ -25,8 +25,6 @@ module Pageflow
25
25
  column :first_name
26
26
  column :last_name
27
27
  column :email
28
- column :last_sign_in_at
29
- column :sign_in_count
30
28
  column :suspended?
31
29
  end
32
30
 
@@ -122,9 +120,11 @@ module Pageflow
122
120
 
123
121
  collection_action :quota_state do
124
122
  @account = Pageflow::Account.find(params[:account_id])
125
- authorize!(:add_member_to, @account)
126
-
127
- render(layout: false)
123
+ if authorized?(:see_user_quota, @account)
124
+ render(layout: false)
125
+ else
126
+ render(partial: 'not_allowed_to_see_user_quota')
127
+ end
128
128
  end
129
129
 
130
130
  collection_action 'me', title: I18n.t('pageflow.admin.users.account'), method: [:get, :patch] do
@@ -85,4 +85,69 @@ jQuery(function($) {
85
85
  return $(folder).data('role') === 'all';
86
86
  }
87
87
  });
88
+
89
+ $('.admin_entries form.entry').each(function() {
90
+ var accountSelect = $('#entry_account_id', this);
91
+ var entryTypeInput = $('#entry_type_name_input', this);
92
+ var entryTypeSelect = $('#entry_type_name', this);
93
+ var entryTypeOptions = $('#entry_type_name option', this);
94
+
95
+ function updateEntryTypeOptions() {
96
+ var selectedAccountId = accountSelect.val();
97
+ hideAllOptions();
98
+
99
+ $.get('/admin/entries/entry_types?account_id=' + selectedAccountId)
100
+ .done(function(response) {
101
+ var typeNames = response.map(function(item) {
102
+ return item.type_name;
103
+ });
104
+ updateForm(typeNames);
105
+ if (currentSelectedUnavailable(typeNames)) {
106
+ updateSelected(typeNames[0]);
107
+ }
108
+ if (response.length < 2) {
109
+ hideInput();
110
+ } else {
111
+ showInput();
112
+ }
113
+ });
114
+ }
115
+
116
+ function updateForm(entryTypes) {
117
+ entryTypes.forEach(showOption);
118
+ }
119
+
120
+ function currentSelectedUnavailable(entryTypes) {
121
+ var selectedEntryType = entryTypeSelect.children('option:selected').val();
122
+
123
+ return !entryTypes.includes(selectedEntryType);
124
+ }
125
+
126
+ function updateSelected(firstAvailable) {
127
+ entryTypeSelect.val(firstAvailable);
128
+ }
129
+
130
+ function hideInput() {
131
+ entryTypeInput.hide();
132
+ }
133
+
134
+ function showInput() {
135
+ entryTypeInput.show();
136
+ }
137
+
138
+ function hideAllOptions() {
139
+ entryTypeOptions.each(function() {
140
+ $(this).hide();
141
+ });
142
+ }
143
+
144
+ function showOption(entryType) {
145
+ $('#entry_type_name option[value=' + entryType + ']').show();
146
+ }
147
+
148
+ if (entryTypeOptions.length > 1) {
149
+ accountSelect.on('change', updateEntryTypeOptions);
150
+ updateEntryTypeOptions();
151
+ }
152
+ });
88
153
  });
@@ -8,7 +8,7 @@ jQuery(function($) {
8
8
  var selectedAccountId = accountSelect.val();
9
9
 
10
10
  $.get('/admin/users/quota_state?account_id=' + selectedAccountId)
11
- .success(function(html) {
11
+ .done(function(html) {
12
12
  quotaStateContainer.html(html);
13
13
  updateForm();
14
14
  });
@@ -1,3 +1,4 @@
1
+ var pageflow = window.pageflow || {};
1
2
  pageflow.assetUrls = {
2
3
  unmuteSound: '<%= asset_path("pageflow/unmute.mp3") %>',
3
4
  largeBandwidthProbe: '<%= Rails.env.test? ? asset_path("bandwidth_probe_large.png") : "//#{File.join(Pageflow.config.zencoder_options[:s3_host_alias], "bandwidth_probe_large.png")}" %>',
@@ -1,12 +0,0 @@
1
- // base JavaScript file for Pageflow.
2
- // This file is meant to hold code we develop.
3
- // And vendor code that changes a lot.
4
-
5
- //= require polyfills/bind
6
-
7
- //= require ./videojs
8
-
9
- //= require ./dist/frontend
10
- //= require ./dist/react-client
11
-
12
- //= require ./asset_urls
@@ -1,7 +1,3 @@
1
- // Files in the dist folder are generated by Webpack in the
2
- // packages/pageflow-react directory.
1
+ // Deprecation: File moved to pageflow_paged
3
2
 
4
- //= require_self
5
- //= require pageflow/dist/react-server
6
-
7
- var PAGEFLOW_EDITOR = false;
3
+ //= require pageflow_paged/components
@@ -158,10 +158,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
158
158
  }
159
159
 
160
160
  function _iterableToArrayLimit(arr, i) {
161
- if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
162
- return;
163
- }
164
-
161
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
165
162
  var _arr = [];
166
163
  var _n = true;
167
164
  var _d = false;
@@ -187,12 +184,31 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
187
184
  return _arr;
188
185
  }
189
186
 
187
+ function _arrayLikeToArray(arr, len) {
188
+ if (len == null || len > arr.length) len = arr.length;
189
+
190
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
191
+ arr2[i] = arr[i];
192
+ }
193
+
194
+ return arr2;
195
+ }
196
+
197
+ function _unsupportedIterableToArray(o, minLen) {
198
+ if (!o) return;
199
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
200
+ var n = Object.prototype.toString.call(o).slice(8, -1);
201
+ if (n === "Object" && o.constructor) n = o.constructor.name;
202
+ if (n === "Map" || n === "Set") return Array.from(n);
203
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
204
+ }
205
+
190
206
  function _nonIterableRest() {
191
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
207
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
192
208
  }
193
209
 
194
210
  function _slicedToArray(arr, i) {
195
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
211
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
196
212
  }
197
213
 
198
214
  /**
@@ -274,7 +290,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
274
290
  * <button class=${styles.addButton}></button>
275
291
  * `,
276
292
  *
277
- * events: cssModulesUtils.ui(styles, {
293
+ * events: cssModulesUtils.events(styles, {
278
294
  * 'click addButton': () => console.log('clicked add button');
279
295
  * })
280
296
  * });
@@ -1009,10 +1025,14 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1009
1025
  this.ui.label.text(text);
1010
1026
  this.$el.toggleClass('align_bottom_right', options.align === 'bottom right');
1011
1027
  this.$el.toggleClass('align_bottom_left', options.align === 'bottom left');
1028
+ this.$el.toggleClass('align_top_center', options.align === 'top center');
1012
1029
 
1013
1030
  if (options.align === 'bottom right' || options.align === 'bottom left') {
1014
1031
  offsetTop = 10;
1015
1032
  offsetLeft = 0;
1033
+ } else if (options.align === 'top center') {
1034
+ offsetTop = -10;
1035
+ offsetLeft = 0;
1016
1036
  } else {
1017
1037
  offsetTop = -17;
1018
1038
  offsetLeft = 10;
@@ -1120,13 +1140,30 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1120
1140
  * A text that will be appended to the translation based inline
1121
1141
  * text.
1122
1142
  *
1123
- * @param {boolean} [options.disabled]
1124
- * Render input as disabled.
1143
+ * @param {string|string[]} [options.disabledBinding]
1144
+ * Name of an attribute to control whether the input is disabled. If
1145
+ * the `disabled` and `disabledBinding` options are not set,
1146
+ * input will be disabled whenever this attribute has a truthy value.
1147
+ * When multiple attribute names are passed, the function passed to
1148
+ * the `disabled` option will receive an array of values in the same
1149
+ * order.
1150
+ *
1151
+ * @param {function|boolean} [options.disabled]
1152
+ * Render input as disabled. A Function taking the value of the
1153
+ * `disabledBinding` attribute as parameter. Input will be disabled
1154
+ * only if function returns `true`.
1155
+ *
1156
+ * @param {any} [options.disabledBindingValue]
1157
+ * Input will be disabled whenever the value of the `disabledBinding`
1158
+ * attribute equals the value of this option.
1125
1159
  *
1126
- * @param {string} [options.visibleBinding]
1160
+ * @param {string|string[]} [options.visibleBinding]
1127
1161
  * Name of an attribute to control whether the input is visible. If
1128
1162
  * the `visible` and `visibleBindingValue` options are not set,
1129
1163
  * input will be visible whenever this attribute has a truthy value.
1164
+ * When multiple attribute names are passed, the function passed to
1165
+ * the `visible` option will receive an array of values in the same
1166
+ * order.
1130
1167
  *
1131
1168
  * @param {function|boolean} [options.visible]
1132
1169
  * A Function taking the value of the `visibleBinding` attribute as
@@ -1181,15 +1218,10 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1181
1218
  this.$el.data('labelText', this.labelText());
1182
1219
  this.$el.data('inlineHelpText', this.inlineHelpText());
1183
1220
  this.ui.labelText.text(this.labelText());
1184
- this.ui.inlineHelp.html(this.inlineHelpText());
1185
-
1186
- if (!this.inlineHelpText()) {
1187
- this.ui.inlineHelp.hide();
1188
- }
1189
-
1221
+ this.updateInlineHelp();
1190
1222
  this.setLabelFor();
1191
- this.updateDisabled();
1192
- this.setupVisibleBinding();
1223
+ this.setupAttributeBinding('disabled', this.updateDisabled);
1224
+ this.setupAttributeBinding('visible', this.updateVisible);
1193
1225
  },
1194
1226
 
1195
1227
  /**
@@ -1204,6 +1236,13 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1204
1236
  fallbackPrefix: 'activerecord.attributes'
1205
1237
  }));
1206
1238
  },
1239
+ updateInlineHelp: function updateInlineHelp() {
1240
+ this.ui.inlineHelp.html(this.inlineHelpText());
1241
+
1242
+ if (!this.inlineHelpText()) {
1243
+ this.ui.inlineHelp.hide();
1244
+ }
1245
+ },
1207
1246
 
1208
1247
  /**
1209
1248
  * The inline help text for the form field.
@@ -1214,7 +1253,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1214
1253
  fallbackPrefix: 'pageflow.ui.inline_help'
1215
1254
  });
1216
1255
 
1217
- if (this.options.disabled) {
1256
+ if (this.isDisabled()) {
1218
1257
  keys = translationKeysWithSuffix(keys, 'disabled');
1219
1258
  }
1220
1259
 
@@ -1230,40 +1269,61 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1230
1269
  this.ui.label.attr('for', id);
1231
1270
  }
1232
1271
  },
1272
+ isDisabled: function isDisabled() {
1273
+ return this.getAttributeBoundOption('disabled');
1274
+ },
1233
1275
  updateDisabled: function updateDisabled() {
1276
+ this.updateInlineHelp();
1277
+
1234
1278
  if (this.ui.input) {
1235
1279
  this.updateDisabledAttribute(this.ui.input);
1236
1280
  }
1237
1281
  },
1238
1282
  updateDisabledAttribute: function updateDisabledAttribute(element) {
1239
- if (this.options.disabled) {
1283
+ if (this.isDisabled()) {
1240
1284
  element.attr('disabled', true);
1241
1285
  } else {
1242
1286
  element.removeAttr('disabled');
1243
1287
  }
1244
1288
  },
1245
- setupVisibleBinding: function setupVisibleBinding() {
1289
+ updateVisible: function updateVisible() {
1290
+ this.$el.toggleClass('input-hidden_via_binding', this.getAttributeBoundOption('visible') === false);
1291
+ },
1292
+ setupAttributeBinding: function setupAttributeBinding(optionName, updateMethod) {
1293
+ var _this = this;
1294
+
1295
+ var binding = this.options["".concat(optionName, "Binding")];
1246
1296
  var view = this;
1247
1297
 
1248
- if (this.options.visibleBinding) {
1249
- this.listenTo(this.model, 'change:' + this.options.visibleBinding, updateVisible);
1250
- updateVisible(this.model, this.model.get(this.options.visibleBinding));
1298
+ if (binding) {
1299
+ _.flatten([binding]).forEach(function (attribute) {
1300
+ _this.listenTo(_this.model, 'change:' + attribute, update);
1301
+ });
1251
1302
  }
1252
1303
 
1253
- function updateVisible(model, value) {
1254
- view.$el.toggleClass('input-hidden_via_binding', !isVisible(value));
1304
+ update();
1305
+
1306
+ function update() {
1307
+ updateMethod.call(view, view.getAttributeBoundOption(optionName));
1255
1308
  }
1309
+ },
1310
+ getAttributeBoundOption: function getAttributeBoundOption(optionName) {
1311
+ var _this2 = this;
1256
1312
 
1257
- function isVisible(value) {
1258
- if ('visibleBindingValue' in view.options) {
1259
- return value === view.options.visibleBindingValue;
1260
- } else if (typeof view.options.visible === 'function') {
1261
- return !!view.options.visible(value);
1262
- } else if ('visible' in view.options) {
1263
- return !!view.options.visible;
1264
- } else {
1265
- return !!value;
1266
- }
1313
+ var binding = this.options["".concat(optionName, "Binding")];
1314
+ var bindingValueOptionName = "".concat(optionName, "BindingValue");
1315
+ var value = Array.isArray(binding) ? binding.map(function (attribute) {
1316
+ return _this2.model.get(attribute);
1317
+ }) : this.model.get(binding);
1318
+
1319
+ if (bindingValueOptionName in this.options) {
1320
+ return value === this.options[bindingValueOptionName];
1321
+ } else if (typeof this.options[optionName] === 'function') {
1322
+ return !!this.options[optionName](value);
1323
+ } else if (optionName in this.options) {
1324
+ return !!this.options[optionName];
1325
+ } else if (binding) {
1326
+ return !!value;
1267
1327
  }
1268
1328
  }
1269
1329
  };
@@ -1414,11 +1474,14 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1414
1474
  this.listenTo(this.model, 'change:' + this.options.placeholderBinding, this.updatePlaceholder);
1415
1475
  }
1416
1476
  },
1477
+ updateDisabled: function updateDisabled() {
1478
+ this.updatePlaceholder();
1479
+ },
1417
1480
  updatePlaceholder: function updatePlaceholder() {
1418
1481
  this.ui.input.attr('placeholder', this.placeholderText());
1419
1482
  },
1420
1483
  placeholderText: function placeholderText() {
1421
- if (!this.options.disabled || !this.options.hidePlaceholderIfDisabled) {
1484
+ if (!this.isDisabled() || !this.options.hidePlaceholderIfDisabled) {
1422
1485
  if (this.options.placeholder) {
1423
1486
  if (typeof this.options.placeholder == 'function') {
1424
1487
  return this.options.placeholder(this.model);
@@ -1429,6 +1492,8 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1429
1492
  return this.placeholderModelValue();
1430
1493
  }
1431
1494
  }
1495
+
1496
+ return '';
1432
1497
  },
1433
1498
  placeholderModelValue: function placeholderModelValue() {
1434
1499
  return this.options.placeholderModel && this.options.placeholderModel.get(this.options.propertyName);
@@ -1581,12 +1646,22 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1581
1646
  this.updateSettings();
1582
1647
  },
1583
1648
  updateSettings: function updateSettings() {
1649
+ this.resetSwatchesInStoredSettings();
1584
1650
  this.ui.input.minicolors('settings', {
1585
1651
  defaultValue: this.defaultValue(),
1586
1652
  swatches: this.getSwatches()
1587
1653
  });
1588
1654
  this.load();
1589
1655
  },
1656
+ // see https://github.com/claviska/jquery-minicolors/issues/287
1657
+ resetSwatchesInStoredSettings: function resetSwatchesInStoredSettings() {
1658
+ var settings = this.ui.input.data('minicolors-settings');
1659
+
1660
+ if (settings) {
1661
+ delete settings.swatches;
1662
+ this.ui.input.data('minicolors-settings', settings);
1663
+ }
1664
+ },
1590
1665
  load: function load() {
1591
1666
  this.ui.input.minicolors('value', this.model.get(this.options.propertyName) || this.defaultValue());
1592
1667
  this.$el.toggleClass('is_default', !this.model.has(this.options.propertyName));
@@ -1692,6 +1767,10 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1692
1767
  * value of the `placeholderModel` occurs whenever the attribute is
1693
1768
  * blank.
1694
1769
  *
1770
+ * @param {function} [options.optionDisabled]
1771
+ * Receives value and has to return boolean indicating whether
1772
+ * option is disabled.
1773
+ *
1695
1774
  * @class
1696
1775
  */
1697
1776
 
@@ -1794,6 +1873,10 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1794
1873
  option.value = value;
1795
1874
  option.text = this.options.texts[index];
1796
1875
 
1876
+ if (this.options.optionDisabled && this.options.optionDisabled(value)) {
1877
+ option.setAttribute('disabled', true);
1878
+ }
1879
+
1797
1880
  if (group) {
1798
1881
  option.setAttribute('data-group', group);
1799
1882
  this.findOrCreateOptGroup(group).append(option);
@@ -1818,10 +1901,10 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1818
1901
  if (!this.isClosed) {
1819
1902
  var value = this.model.get(this.options.propertyName);
1820
1903
 
1821
- if (this.model.has(this.options.propertyName) && this.ui.select.find('option[value="' + value + '"]').length) {
1904
+ if (this.model.has(this.options.propertyName) && this.ui.select.find('option[value="' + value + '"]:not([disabled])').length) {
1822
1905
  this.ui.select.val(value);
1823
1906
  } else {
1824
- this.ui.select.val(this.ui.select.find('option:first').val());
1907
+ this.ui.select.val(this.ui.select.find('option:not([disabled]):first').val());
1825
1908
  }
1826
1909
  }
1827
1910
  }
@@ -1950,7 +2033,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
1950
2033
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab') )) == null ? '' : __t) +
1951
2034
  '\n </label>\n <span class="inline_help">\n ' +
1952
2035
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.open_in_new_tab_help') )) == null ? '' : __t) +
1953
- '\n </span>\n </div>\n </div>\n <div class="fragment_link_panel">\n <!-- LinkInputView is inserted here -->\n </div>\n\n <!-- wysihtml5 does not handle hidden fields correctly -->\n <div class="internal">\n <input type="text" data-wysihtml5-dialog-field="href" class="current_url" value="http://">\n <input type="text" data-wysihtml5-dialog-field="target" class="current_target" value="_blank">\n </div>\n\n <a class="button" data-wysihtml5-dialog-action="save">\n ' +
2036
+ '\n </span>\n </div>\n </div>\n <div class="fragment_link_panel">\n <!-- LinkInputView is inserted here -->\n </div>\n\n <!-- wysihtml5 does not handle hidden fields correctly -->\n <div class="internal">\n <input type="text" data-wysihtml5-dialog-field="href" class="current_url" value="">\n <input type="text" data-wysihtml5-dialog-field="target" class="current_target" value="_blank">\n </div>\n\n <a class="button" data-wysihtml5-dialog-action="save">\n ' +
1954
2037
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.save') )) == null ? '' : __t) +
1955
2038
  '\n </a>\n <a class="button" data-wysihtml5-dialog-action="cancel">\n ' +
1956
2039
  ((__t = ( I18n.t('pageflow.ui.templates.inputs.text_area_input.cancel') )) == null ? '' : __t) +
@@ -2097,7 +2180,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2097
2180
  var currentUrl = this.ui.urlInput.val();
2098
2181
 
2099
2182
  if (currentUrl.startsWith('#')) {
2100
- this.ui.displayUrlInput.val('http://');
2183
+ this.ui.displayUrlInput.val('');
2101
2184
  this.ui.openInNewTabCheckBox.prop('checked', true);
2102
2185
  } else {
2103
2186
  this.ui.displayUrlInput.val(currentUrl);
@@ -2163,6 +2246,21 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2163
2246
  }
2164
2247
  });
2165
2248
 
2249
+ function _defineProperty(obj, key, value) {
2250
+ if (key in obj) {
2251
+ Object.defineProperty(obj, key, {
2252
+ value: value,
2253
+ enumerable: true,
2254
+ configurable: true,
2255
+ writable: true
2256
+ });
2257
+ } else {
2258
+ obj[key] = value;
2259
+ }
2260
+
2261
+ return obj;
2262
+ }
2263
+
2166
2264
  function template$9(data) {
2167
2265
  var __p = '';
2168
2266
  __p += '<label>\n <span class="name"></span>\n <span class="inline_help"></span>\n</label>\n<input type="text" />\n<div class="validation"></div>\n';
@@ -2205,24 +2303,32 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2205
2303
  this.validate();
2206
2304
  },
2207
2305
  onChange: function onChange() {
2208
- var view = this;
2209
- this.saveDisplayProperty();
2210
- this.validate().done(function () {
2211
- view.save();
2306
+ var _this = this;
2307
+
2308
+ this.validate().then(function () {
2309
+ return _this.save();
2310
+ }, function () {
2311
+ return _this.saveDisplayProperty();
2212
2312
  });
2213
2313
  },
2214
2314
  saveDisplayProperty: function saveDisplayProperty() {
2315
+ this.model.unset(this.options.propertyName, {
2316
+ silent: true
2317
+ });
2215
2318
  this.model.set(this.options.displayPropertyName, this.ui.input.val());
2216
- this.model.unset(this.options.propertyName);
2217
2319
  },
2218
2320
  save: function save() {
2219
- var view = this;
2220
- $.when(this.transformPropertyValue(this.ui.input.val())).then(function (value) {
2221
- view.model.set(view.options.propertyName, value);
2321
+ var _this2 = this;
2322
+
2323
+ var value = this.ui.input.val();
2324
+ $.when(this.transformPropertyValue(value)).then(function (transformedValue) {
2325
+ var _this2$model$set;
2326
+
2327
+ _this2.model.set((_this2$model$set = {}, _defineProperty(_this2$model$set, _this2.options.displayPropertyName, value), _defineProperty(_this2$model$set, _this2.options.propertyName, transformedValue), _this2$model$set));
2222
2328
  });
2223
2329
  },
2224
2330
  load: function load() {
2225
- this.ui.input.val(this.model.get(this.options.displayPropertyName));
2331
+ this.ui.input.val(this.model.has(this.options.displayPropertyName) ? this.model.get(this.options.displayPropertyName) : this.model.get(this.options.propertyName));
2226
2332
  this.onLoad();
2227
2333
  },
2228
2334
 
@@ -2431,6 +2537,15 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2431
2537
  });
2432
2538
  this.load();
2433
2539
  },
2540
+ updateDisabled: function updateDisabled(disabled) {
2541
+ this.$el.toggleClass('disabled', !!disabled);
2542
+
2543
+ if (disabled) {
2544
+ this.ui.widget.slider('disable');
2545
+ } else {
2546
+ this.ui.widget.slider('enable');
2547
+ }
2548
+ },
2434
2549
  save: function save() {
2435
2550
  var value = this.ui.widget.slider('option', 'value');
2436
2551
  var unit = 'unit' in this.options ? this.options.unit : '%';
@@ -2555,8 +2670,11 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2555
2670
  this.load();
2556
2671
  this.listenTo(this.model, 'change:' + this.options.propertyName, this.load);
2557
2672
  },
2673
+ updateDisabled: function updateDisabled() {
2674
+ this.load();
2675
+ },
2558
2676
  save: function save() {
2559
- if (!this.options.disabled) {
2677
+ if (!this.isDisabled()) {
2560
2678
  this.model.set(this.options.propertyName, this.ui.input.is(':checked'));
2561
2679
  }
2562
2680
  },
@@ -2566,7 +2684,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2566
2684
  }
2567
2685
  },
2568
2686
  displayValue: function displayValue() {
2569
- if (this.options.disabled && this.options.displayUncheckedIfDisabled) {
2687
+ if (this.isDisabled() && this.options.displayUncheckedIfDisabled) {
2570
2688
  return false;
2571
2689
  } else {
2572
2690
  return this.model.get(this.options.propertyName);
@@ -2799,8 +2917,8 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2799
2917
  events: {
2800
2918
  'mouseover [data-tooltip]': function mouseoverDataTooltip(event) {
2801
2919
  if (!this.tooltip.visible) {
2802
- var target = $(event.target);
2803
- var key = target.data('tooltip');
2920
+ var target = $(event.currentTarget);
2921
+ var key = target.attr('data-tooltip');
2804
2922
  var position;
2805
2923
 
2806
2924
  if (target.data('tooltipAlign') === 'bottom left') {
@@ -2813,6 +2931,11 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2813
2931
  left: target.position().left + target.outerWidth(),
2814
2932
  top: target.position().top + target.outerHeight()
2815
2933
  };
2934
+ } else if (target.data('tooltipAlign') === 'top center') {
2935
+ position = {
2936
+ left: target.position().left + target.outerWidth() / 2,
2937
+ top: target.position().top + 2
2938
+ };
2816
2939
  } else {
2817
2940
  position = {
2818
2941
  left: target.position().left + target.outerWidth(),
@@ -2825,7 +2948,7 @@ this.pageflow._uiGlobalInterop = (function (exports, Marionette, _, $, I18n$1, B
2825
2948
  });
2826
2949
  }
2827
2950
  },
2828
- 'mouseout [data-tooltip]': function mouseoutDataTooltip() {
2951
+ 'mouseleave [data-tooltip]': function mouseleaveDataTooltip() {
2829
2952
  this.tooltip.hide();
2830
2953
  }
2831
2954
  },