@concretecms/bedrock 1.3.7 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/.eslintrc.yml +2 -0
  2. package/assets/account/js/frontend/components/AvatarCropper.vue +159 -0
  3. package/assets/account/js/frontend.js +1 -1
  4. package/assets/account/scss/frontend/_frontend.scss +2 -0
  5. package/assets/account/scss/frontend/avatar/_avatar-cropper.scss +82 -0
  6. package/assets/account/scss/frontend/avatar/_avatar.scss +6 -0
  7. package/assets/bedrock/scss/_frontend.scss +0 -1
  8. package/assets/calendar/js/backend/duration.js +13 -13
  9. package/assets/calendar/js/vendor/fullcalendar.js +1 -0
  10. package/assets/cms/components/Announcement/Action/ExternalLinkAction.vue +25 -0
  11. package/assets/cms/components/Announcement/Action/GuideAction.vue +36 -0
  12. package/assets/cms/components/Announcement/Action/VideoAction.vue +31 -0
  13. package/assets/cms/components/Announcement/Broadcast.vue +63 -0
  14. package/assets/cms/components/Announcement/Button/ExternalLinkButton.vue +26 -0
  15. package/assets/cms/components/Announcement/Header/Header.vue +33 -0
  16. package/assets/cms/components/Announcement/Item/Item.vue +50 -0
  17. package/assets/cms/components/Announcement/Modal/Modal.vue +77 -0
  18. package/assets/cms/components/Announcement/Slide/CollectSiteInformationSlide.vue +61 -0
  19. package/assets/cms/components/Announcement/Slide/FeatureSlide.vue +81 -0
  20. package/assets/cms/components/Announcement/Slide/WelcomeSlide.vue +87 -0
  21. package/assets/cms/components/Help/Modal.vue +48 -0
  22. package/assets/cms/components/Image/ThumbnailEditor.vue +117 -0
  23. package/assets/cms/components/RunningProcessList.vue +6 -1
  24. package/assets/cms/components/customizer/FontFamilyPageCustomizerWidget.vue +27 -7
  25. package/assets/cms/components/file-manager/Chooser/FileManager.vue +0 -1
  26. package/assets/cms/components/file-manager/Chooser/FolderBookmark.vue +0 -1
  27. package/assets/cms/components/file-manager/Chooser.vue +1 -1
  28. package/assets/cms/components/form/ConcreteAjaxSelect.vue +173 -0
  29. package/assets/cms/components/form/ConcreteExpressEntrySelect.vue +74 -0
  30. package/assets/cms/components/form/ConcreteFileDirectoryInput.vue +28 -26
  31. package/assets/cms/components/form/ConcreteFileInput.vue +17 -5
  32. package/assets/cms/components/form/ConcreteGroupInput.vue +134 -0
  33. package/assets/cms/components/form/ConcreteLocaleSelect.vue +58 -0
  34. package/assets/cms/components/form/ConcreteOptionSelect.vue +92 -0
  35. package/assets/cms/components/form/ConcretePageSelect.vue +67 -0
  36. package/assets/cms/components/form/ConcreteSelect.vue +75 -0
  37. package/assets/cms/components/form/ConcreteThemeColorInput.vue +19 -14
  38. package/assets/cms/components/form/ConcreteUserInput.vue +24 -4
  39. package/assets/cms/components/form/ConcreteUserSelect.vue +126 -0
  40. package/assets/cms/components/form/IconSelector.vue +14 -5
  41. package/assets/cms/components/form/PasswordInput.vue +141 -24
  42. package/assets/cms/components/groups/Chooser.vue +6 -5
  43. package/assets/cms/components/index.js +24 -0
  44. package/assets/cms/components/toolbar/ConcreteToolbarSiteList.vue +62 -0
  45. package/assets/cms/components/user/Chooser/Search.vue +5 -0
  46. package/assets/cms/components/user/Chooser/Users.vue +6 -2
  47. package/assets/cms/components/user/Chooser.vue +9 -3
  48. package/assets/cms/js/ajax-request/base.js +13 -4
  49. package/assets/cms/js/alert.js +2 -1
  50. package/assets/cms/js/base.js +3 -10
  51. package/assets/cms/js/edit-mode/area.js +0 -35
  52. package/assets/cms/js/edit-mode/block.js +27 -0
  53. package/assets/cms/js/edit-mode/containerblock.js +33 -3
  54. package/assets/cms/js/edit-mode/editmode.js +12 -0
  55. package/assets/cms/js/edit-mode/layout.js +56 -0
  56. package/assets/cms/js/edit-mode/style-customizer/style-customizer.js +0 -1
  57. package/assets/cms/js/file-manager/uploader.js +30 -206
  58. package/assets/cms/js/help/help.js +11 -8
  59. package/assets/cms/js/in-context-menu.js +5 -0
  60. package/assets/cms/js/jquery-vue.js +22 -0
  61. package/assets/cms/js/legacy-dialog.js +74 -65
  62. package/assets/cms/js/modal.js +73 -0
  63. package/assets/cms/js/panels.js +8 -0
  64. package/assets/cms/js/search/base.js +0 -18
  65. package/assets/cms/js/search/field-selector.js +6 -14
  66. package/assets/cms/js/select-combo-box.js +2 -0
  67. package/assets/cms/js/sitemap/sitemap-selector.js +2 -2
  68. package/assets/cms/js/sitemap/sitemap.js +15 -20
  69. package/assets/cms/js/toolbar.js +25 -2
  70. package/assets/cms/js/tree.js +7 -7
  71. package/assets/cms/js/users/group-manager.js +55 -0
  72. package/assets/cms/js/users/user-manager.js +2 -1
  73. package/assets/cms/js/users.js +1 -0
  74. package/assets/cms/js/vue/Manager.js +6 -3
  75. package/assets/cms/scss/_base.scss +2 -8
  76. package/assets/cms/scss/_cards.scss +7 -0
  77. package/assets/cms/scss/_file-manager.scss +1 -0
  78. package/assets/cms/scss/_file-uploader.scss +13 -3
  79. package/assets/cms/scss/_help.scss +11 -2
  80. package/assets/cms/scss/_item-selector.scss +10 -0
  81. package/assets/cms/scss/_layouts.scss +16 -0
  82. package/assets/cms/scss/_page-areas.scss +524 -245
  83. package/assets/cms/scss/_popover.scss +5 -0
  84. package/assets/cms/scss/_select-combo-box.scss +18 -0
  85. package/assets/cms/scss/_toolbar.scss +5 -14
  86. package/assets/cms/scss/_transitions.scss +13 -0
  87. package/assets/cms/scss/_variables.scss +18 -7
  88. package/assets/cms/scss/bootstrap/_reboot-tags.scss +17 -32
  89. package/assets/cms/scss/bootstrap/_reboot.scss +17 -7
  90. package/assets/cms/scss/bootstrap/_root-modified.scss +41 -20
  91. package/assets/cms/scss/file-manager/_thumbnail-image-editor.scss +45 -0
  92. package/assets/cms/scss/panels/_help.scss +0 -10
  93. package/assets/staging/scss/frontend/_frontend.scss +12 -0
  94. package/assets/staging/scss/frontend.scss +4 -0
  95. package/package.json +9 -9
  96. package/assets/account/js/frontend/components/Avatar/Avatar.js +0 -270
  97. package/assets/account/js/frontend/components/Avatar/Avatar.scss +0 -17
  98. package/assets/account/js/frontend/components/Avatar/Avatar.vue +0 -18
  99. package/assets/account/js/frontend/components/Avatar/Cropper.js +0 -202
  100. package/assets/account/js/frontend/components/Avatar/Cropper.scss +0 -136
  101. package/assets/account/js/frontend/components/Avatar/Cropper.vue +0 -40
  102. package/assets/bedrock/scss/_theme-grid.scss +0 -7
  103. package/assets/cms/js/edit-mode/style-customizer/inline-toolbar.js +0 -279
  104. package/assets/cms/js/modifiable-ajax-bootstrap-select.js +0 -78
  105. package/assets/cms/js/modifiable-bootstrap-select.js +0 -112
@@ -1,279 +0,0 @@
1
- /* eslint-disable no-new, no-unused-vars, camelcase, no-irregular-whitespace, new-cap */
2
-
3
- /* global bootstrap */
4
- function ConcreteInlineStyleCustomizer($element, options) {
5
- var my = this
6
- options = $.extend({}, options)
7
-
8
- my.options = options
9
- my.$element = $element
10
- my.$toolbar = my.$element.find('>ul')
11
-
12
- my.setupForm()
13
- my.setupButtons()
14
- my.setupSliders()
15
- my.setupDeviceVisibilityComponent()
16
- my.setupDropdowns()
17
- my.setupSelectBoxes()
18
- }
19
-
20
- ConcreteInlineStyleCustomizer.prototype = {
21
-
22
- refreshStyles: function (resp) {
23
- if (resp.oldIssID) {
24
- $('head').find('style[data-style-set=' + resp.oldIssID + ']').remove()
25
- }
26
- if (resp.issID && resp.css) {
27
- $('head').append(resp.css)
28
- }
29
- },
30
-
31
- setupForm: function () {
32
- var my = this
33
- const tooltipTriggerList = [].slice.call(my.$element.find('.launch-tooltip'))
34
- const tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
35
- return new bootstrap.Tooltip(tooltipTriggerEl)
36
- })
37
- my.$element.concreteAjaxForm({
38
- success: function (resp) {
39
- my.handleResponse(resp)
40
- },
41
- error: function (r) {
42
- my.$toolbar.prependTo('#ccm-inline-toolbar-container').show()
43
- }
44
- })
45
- },
46
-
47
- setupButtons: function () {
48
- var my = this
49
- my.$toolbar.on('click.inlineStyleCustomizer', 'input[data-action=cancel-design]', function () {
50
- my.$element.hide()
51
- ConcreteEvent.fire('EditModeExitInline')
52
- return false
53
- })
54
-
55
- my.$toolbar.on('click.inlineStyleCustomizer', 'input[data-action=reset-design]', function () {
56
- $.concreteAjax({
57
- url: $(this).attr('data-reset-action'),
58
- success: function (resp) {
59
- my.handleResponse(resp)
60
- }
61
- })
62
- return false
63
- })
64
-
65
- my.$toolbar.on('click.inlineStyleCustomizer', 'input[data-action=save-design]', function () {
66
- // move the toolbar back into the form so it submits. so great.
67
- my.$toolbar.hide().prependTo(my.$element)
68
- my.$element.submit()
69
- ConcreteEvent.unsubscribe('EditModeExitInlineComplete')
70
- return false
71
- })
72
- },
73
-
74
- setupDropdowns: function () {
75
- var my = this
76
- my.$toolbar.find('.ccm-inline-toolbar-icon-cell > a').on('click', function () {
77
- const $dropdown = $(this).parent().find('.ccm-dropdown-menu')
78
- const isActive = $dropdown.hasClass('active')
79
- my.$toolbar.find('.ccm-inline-toolbar-icon-selected').removeClass('ccm-inline-toolbar-icon-selected')
80
-
81
- $('.ccm-dropdown-menu').removeClass('active')
82
-
83
- if (!isActive) {
84
- $dropdown.addClass('active')
85
- $(this).parent().addClass('ccm-inline-toolbar-icon-selected')
86
- }
87
- })
88
- },
89
-
90
- setupDeviceVisibilityComponent: function () {
91
- var my = this
92
- my.$toolbar.find('button[data-hide-on-device]').on('click', function (e) {
93
- e.stopPropagation()
94
-
95
- const input = $(this).attr('data-hide-on-device')
96
-
97
- if ($(this).hasClass('active')) {
98
- $(this).removeClass('active')
99
- $($('input[data-hide-on-device-input=' + input + ']').val(1))
100
- } else {
101
- $(this).addClass('active')
102
- $($('input[data-hide-on-device-input=' + input + ']').val(0))
103
- }
104
- })
105
- },
106
-
107
- setupSelectBoxes: function () {
108
- var my = this
109
-
110
- my.$toolbar.find('.selectpicker').selectpicker()
111
-
112
- var $customClass = my.$toolbar.find('#customClass')
113
-
114
- $customClass.selectpicker({
115
- liveSearch: true,
116
- allowAdd: true // new option used by our extension of bootstrap-select
117
- })
118
- },
119
-
120
- setupSliders: function () {
121
- var my = this
122
- my.$toolbar.find('.ccm-inline-style-sliders').each(function () {
123
- var targetInput = $(this).next().children('.ccm-inline-style-slider-value')
124
- var targetInputFormat = targetInput.attr('data-value-format')
125
- var sliderElement = $(this)
126
- var min = parseInt($(this).attr('data-style-slider-min'))
127
- var max = parseInt($(this).attr('data-style-slider-max'))
128
- var defaultValue = $(this).attr('data-style-slider-default-setting')
129
- var currentValue = function () {
130
- return parseInt(targetInput.val().replace(/\D-/g, ''))
131
- }
132
- var disableCheck = function () {
133
- if (parseInt(defaultValue) === currentValue() || isNaN(currentValue())) {
134
- targetInput.prop('disabled', true).val(defaultValue + targetInputFormat)
135
- }
136
- }
137
-
138
- sliderElement.slider({
139
- min: min,
140
- max: max,
141
- value: currentValue(),
142
- slide: function (event, ui) {
143
- targetInput.prop('disabled', false)
144
- targetInput.val(ui.value + targetInputFormat)
145
- disableCheck()
146
- }
147
- })
148
-
149
- targetInput.change(function () {
150
- var value = currentValue()
151
-
152
- if (value > max) {
153
- value = max
154
- } else if (value < min) {
155
- value = min
156
- } else if (isNaN(value)) {
157
- value = defaultValue
158
- }
159
-
160
- $(this).val(value + targetInputFormat)
161
- sliderElement.slider('value', value)
162
- disableCheck()
163
- }).blur(function () {
164
- disableCheck()
165
- }).parent().click(function () {
166
- if (targetInput.prop('disabled')) {
167
- targetInput.prop('disabled', false).select()
168
- }
169
- })
170
-
171
- disableCheck()
172
- })
173
- }
174
-
175
- }
176
-
177
- function ConcreteBlockInlineStyleCustomizer($element, options) {
178
- var my = this
179
- ConcreteInlineStyleCustomizer.call(my, $element, options)
180
- }
181
-
182
- ConcreteBlockInlineStyleCustomizer.prototype = Object.create(ConcreteInlineStyleCustomizer.prototype)
183
-
184
- ConcreteBlockInlineStyleCustomizer.prototype.handleResponse = function (resp) {
185
- var my = this
186
- var editor = new Concrete.getEditMode()
187
- var area = editor.getAreaByID(resp.aID)
188
- var block = area.getBlockByID(parseInt(resp.originalBlockID))
189
- var arEnableGridContainer = area.getEnableGridContainer() ? 1 : 0
190
- var action = CCM_DISPATCHER_FILENAME + '/ccm/system/block/render'
191
-
192
- $.get(action, {
193
- arHandle: area.getHandle(),
194
- cID: resp.cID,
195
- bID: resp.bID,
196
- arEnableGridContainer: arEnableGridContainer
197
- }, function (r) {
198
- ConcreteToolbar.disableDirectExit()
199
- var newBlock = block.replace(r)
200
- ConcreteAlert.notify({
201
- message: resp.message
202
- })
203
-
204
- my.refreshStyles(resp)
205
- ConcreteEvent.fire('EditModeExitInline', {
206
- action: 'save_inline',
207
- block: newBlock
208
- })
209
- ConcreteEvent.fire('EditModeExitInlineComplete', {
210
- block: newBlock
211
- })
212
- $.fn.dialog.hideLoader()
213
- editor.destroyInlineEditModeToolbars()
214
- editor.scanBlocks()
215
- })
216
- }
217
-
218
- function ConcreteAreaInlineStyleCustomizer($element, options) {
219
- var my = this
220
- ConcreteInlineStyleCustomizer.call(my, $element, options)
221
- }
222
-
223
- ConcreteAreaInlineStyleCustomizer.prototype = Object.create(ConcreteInlineStyleCustomizer.prototype)
224
-
225
- ConcreteAreaInlineStyleCustomizer.prototype.handleResponse = function (resp) {
226
- var my = this
227
- var editor = new Concrete.getEditMode()
228
- var area = editor.getAreaByID(resp.aID)
229
- my.refreshStyles(resp)
230
- area.getElem().removeClassExcept('ccm-area ccm-global-area')
231
- if (resp.containerClass) {
232
- area.getElem().addClass(resp.containerClass)
233
- }
234
- editor.destroyInlineEditModeToolbars()
235
- }
236
-
237
- // jQuery Plugin
238
- $.fn.concreteBlockInlineStyleCustomizer = function (options) {
239
- return $.each($(this), function (i, obj) {
240
- new ConcreteBlockInlineStyleCustomizer($(this), options)
241
- })
242
- }
243
-
244
- $.fn.concreteAreaInlineStyleCustomizer = function (options) {
245
- return $.each($(this), function (i, obj) {
246
- new ConcreteAreaInlineStyleCustomizer($(this), options)
247
- })
248
- }
249
-
250
- $.fn.concreteInlineStyleCustomizer = function (options) {
251
- return $.each($(this), function (i, obj) {
252
- if ($(this).data('targetElement') === 'block') {
253
- new ConcreteBlockInlineStyleCustomizer($(this), options)
254
- } else {
255
- new ConcreteAreaInlineStyleCustomizer($(this), options)
256
- }
257
- })
258
- }
259
-
260
- $.fn.removeClassExcept = function (val) {
261
- return this.each(function (index, el) {
262
- var keep = val.split(' ')
263
- var reAdd = [] // ones that should be re-added if found
264
- var $el = $(el) // element we're working on
265
-
266
- // look for which we re-add (based on them already existing)
267
- for (var i = 0; i < keep.length; i++) {
268
- if ($el.hasClass(keep[i])) reAdd.push(keep[i])
269
- }
270
-
271
- // drop all, and only add those confirmed as existing
272
- $el
273
- .removeClass() // remove existing classes
274
- .addClass(reAdd.join(' '))
275
- })
276
- }
277
-
278
- global.ConcreteBlockInlineStyleCustomizer = ConcreteBlockInlineStyleCustomizer
279
- global.ConcreteAreaInlineStyleCustomizer = ConcreteAreaInlineStyleCustomizer
@@ -1,78 +0,0 @@
1
- /* eslint-disable no-new, no-unused-vars, camelcase, eqeqeq */
2
-
3
- /* Extend ajax-bootstrap-select */ ;
4
- ;(function (global, $) {
5
- // grab a reference to existing functions
6
- var _init = window.AjaxBootstrapSelect.prototype.init
7
- var _complete = window.AjaxBootstrapSelectRequest.prototype.complete
8
- var _setStatus = window.AjaxBootstrapSelectList.prototype.setStatus
9
-
10
- // extend the prototype with own functions
11
- $.extend(true, window.AjaxBootstrapSelect.prototype, {
12
- init: function () {
13
- var that = this
14
-
15
- _init.apply(this, arguments)
16
-
17
- if (this.selectpicker) {
18
- if (this.selectpicker.options.liveSearch && this.selectpicker.options.allowAdd) {
19
- // Allow options to override locale specific strings.
20
- this.options.locale.statusNoResults = ccmi18n.selectNoResult
21
- this.locale[this.options.langCode] = $.extend(true, {}, this.locale[this.options.langCode], this.options.locale)
22
- }
23
- }
24
-
25
- $(document.body).on('click', '.no-results.ccm-ajax-enhanced-select-input-add-new-term', function (ev) {
26
- ev.stopPropagation()
27
-
28
- var $searchbox = that.selectpicker.$searchbox
29
- if (!$searchbox.length) return
30
- var txt = $searchbox.val()
31
- if (txt) txt.replace(/[|]/g, '')
32
- if ($.trim(txt) == '') return
33
- var data = []
34
- var newOption = {
35
- preserved: that.options.preserveSelected,
36
- disabled: false,
37
- selected: true,
38
- text: txt,
39
- value: txt,
40
- class: ''
41
- }
42
- data.push(newOption)
43
- that.list.selected.push(newOption)
44
- that.list.replaceOptions(data)
45
- $searchbox.trigger('focus')
46
- })
47
- }
48
- })
49
-
50
- $.extend(true, window.AjaxBootstrapSelectRequest.prototype, {
51
- complete: function () {
52
- _complete.apply(this, arguments)
53
-
54
- if (this.plugin.selectpicker.options.liveSearch && this.plugin.selectpicker.options.allowAdd) {
55
- this.plugin.list.$status.removeClass('no-results ccm-ajax-enhanced-select-input-add-new-term')
56
- if (arguments.status !== 'abort') {
57
- var cache = this.plugin.list.cacheGet(this.plugin.query)
58
- if (cache && !cache.length) {
59
- // no results
60
- this.plugin.list.$status.addClass('no-results ccm-ajax-enhanced-select-input-add-new-term')
61
- }
62
- }
63
- }
64
- }
65
- })
66
-
67
- $.extend(true, window.AjaxBootstrapSelectList.prototype, {
68
- setStatus: function () {
69
- if (this.plugin && this.plugin.selectpicker) {
70
- if (arguments[0]) {
71
- // bootstrap-select does this but for some reason ajax-bootstrap-select doesn't so I put it back here
72
- arguments[0] = arguments[0].replace('{0}', '"' + this.plugin.selectpicker.$searchbox.val() + '"')
73
- }
74
- }
75
- _setStatus.apply(this, arguments)
76
- }
77
- })
78
- })(window, jQuery); // eslint-disable-line semi
@@ -1,112 +0,0 @@
1
- /* eslint-disable no-new, no-unused-vars, camelcase, eqeqeq */
2
-
3
- /* Extend bootstrap-select */
4
- ; (function (global, $) {
5
- // grab a reference to existing functions
6
- var _init = $.fn.selectpicker.Constructor.prototype.init
7
- var _destroy = $.fn.selectpicker.Constructor.prototype.destroy
8
-
9
- // extend the prototype with own functions
10
- $.extend(true, $.fn.selectpicker.Constructor.prototype, {
11
- // this will replace the original $.fn.selectpicker.Constructor.prototype.init function
12
- init: function () {
13
- var that = this
14
- var addNoResultClassName = function (addedNode) {
15
- var $addedNode = $(addedNode)
16
- var $addedNodeBsSelect = $addedNode.closest('.bootstrap-select')
17
- if (
18
- $addedNode.hasClass('no-results') &&
19
- $addedNodeBsSelect.length &&
20
- $addedNodeBsSelect.find('select').selectpicker('liveSearch') == true
21
- ) {
22
- $addedNode.addClass('ccm-enhanced-select-input-add-new-term')
23
- }
24
- }
25
-
26
- // always add the required selectize-input class name if not present
27
- if (this.options.styleBase.indexOf('ccm-enhanced-select') == -1) {
28
- this.options.styleBase += ' ccm-enhanced-select'
29
- }
30
-
31
- // call the original init function
32
- _init.apply(this, arguments)
33
-
34
- if (this.options.liveSearch && this.options.allowAdd) {
35
- this.options.noneResultsText = ccmi18n.selectNoResult
36
-
37
- if ('MutationObserver' in window) {
38
- this.allowAddMutationObserver = new MutationObserver(function (mutations) {
39
- mutations.forEach(function (mutation) {
40
- if (mutation.type == 'childList') {
41
- if (mutation.addedNodes.length > 0) {
42
- mutation.addedNodes.forEach(function (addedNode) {
43
- addNoResultClassName(addedNode)
44
- })
45
- }
46
- }
47
- })
48
- })
49
-
50
- this.allowAddMutationObserver.observe(this.$element.closest('.bootstrap-select').get(0), {
51
- childList: true,
52
- subtree: true
53
- })
54
- } else {
55
- $('html').addEventListener('DOMNodeInserted', function (event) {
56
- event.stopImmediatePropagation()
57
- addNoResultClassName(event.target)
58
- }, true)
59
- }
60
-
61
- $(document.body).on('click', '.no-results.ccm-enhanced-select-input-add-new-term', function (ev) {
62
- ev.stopPropagation()
63
-
64
- // the .no-results element is removed and added to the DOM when needed
65
- // So let's turn off the click handler every time
66
- $(this).off('click')
67
-
68
- var $searchbox = that.$searchbox
69
- if (!$searchbox.length) return
70
- var txt = $searchbox.val()
71
- if (txt) txt.replace(/[|]/g, '')
72
- if ($.trim(txt) == '') return
73
- var select = that.$element
74
- var newOption = $('<option>', {
75
- selected: true,
76
- text: txt,
77
- value: txt // [NOUR check what happens with this]
78
- })
79
- var firstOption = $('option', select).eq(1)
80
- if (firstOption.length) {
81
- firstOption.before(newOption)
82
- } else {
83
- select.append(newOption)
84
- }
85
-
86
- select.selectpicker('refresh')
87
- var event = new Event('change', { detail: txt })
88
- select[0].dispatchEvent(event)
89
- $searchbox.trigger('focus')
90
- })
91
- }
92
- },
93
-
94
- // this will replace the original $.fn.selectpicker.Constructor.prototype.destroy function
95
- destroy: function () {
96
- // call the original destroy function
97
- _destroy.apply(this, arguments)
98
-
99
- if (
100
- this.options.liveSearch &&
101
- this.options.allowAdd &&
102
- this.allowAddMutationObserver &&
103
- typeof this.allowAddMutationObserver != 'undefined'
104
- ) {
105
- // free up memory if possible
106
- this.allowAddMutationObserver.disconnect()
107
- this.allowAddMutationObserver = null
108
- }
109
- }
110
- })
111
- // }
112
- })(window, jQuery); // eslint-disable-line semi