arctic_admin 3.2.1 → 4.0.0.alpha

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6f913893bfeb6224b1dd113545dca1818da6e987d64c516d03381aa48828daf
4
- data.tar.gz: 220f72694714143f5c79c791003fba0838ce3bbf5ed2f60675b319dcdadbecff
3
+ metadata.gz: d80f79149e44a52c1d586e425e82313f2d83aea8455d59eaba12a72fb94abc30
4
+ data.tar.gz: ff9b250756327bb54eb0ee374d4cacb0a9cb7b6090da861ee85beceda2534f62
5
5
  SHA512:
6
- metadata.gz: 41cd46ed6aaed2bf349f9ef27237b42e48869d8e025ab497e3ef39bae4fa64ece63428895f32b3c8526aec84000397d37ee643316b850faad18ed7f08a652597
7
- data.tar.gz: ae67be0074df46fd0c19bef15866132936bd1c06900785b7654b22ac2cd8a58c6677bcf23b129dcf4f1e0647c929ba357df7d752675b17530527f74ce1be9f23
6
+ metadata.gz: 6844d6c0fbd22ce592aa64c9f5f27e93033564f44bd7856a3e9d2f3f0ab52ffb5c8a44c106ec9eac85e7dd50c6213649930bfa303a451b4ea867405bc9ded0fd
7
+ data.tar.gz: 159bce7c3570d89754af6964c035497b6adbc0a87f6f709a06fa556c4ddfdd924a48866518336e6424a81cd0efa6ae87df472c3e9f8442d10bf4ef846bb62548
@@ -1,4 +1,2 @@
1
- //= require jquery
2
- //= require jquery_ujs
3
1
  //= require active_admin/base
4
2
  //= require ./main
@@ -1,99 +1,50 @@
1
- $(function () {
2
- var animationFilterDone = true
3
- $(document).on('click touchstart', '#sidebar', function (e) {
4
- if (animationFilterDone == true) {
5
- var position = $(this).position()
6
- var width = $(this).width()
7
- var target = e.target
8
- if (
9
- e.pageX < position.left &&
10
- target.tagName != 'SELECT' &&
11
- target.tagName != 'OPTION'
12
- ) {
13
- if ($(this).css('right') == '0px') {
14
- $(this).css('position', 'fixed')
15
- $(this).animate(
16
- {
17
- right: '-=' + width
18
- },
19
- 600,
20
- function () {
21
- $(this).removeAttr('style')
22
- animationFilterDone = true
23
- }
24
- )
25
- } else {
26
- $(this).animate(
27
- {
28
- right: '+=' + width
29
- },
30
- 600,
31
- function () {
32
- $(this).css('position', 'absolute')
33
- animationFilterDone = true
34
- }
35
- )
36
- }
37
- }
38
- }
39
- })
1
+ document.addEventListener('DOMContentLoaded', () => {
40
2
 
41
- var animationDone = true
42
- $(document).on('click touchstart', '#utility_nav', function (e) {
43
- var position = $(this).position()
44
- var tabs = $('#tabs')
45
- var width = (tabs.length==0)? 0 : Math.round(tabs[0].getBoundingClientRect().width)
46
- if (e.pageX < position.left + 40) {
47
- if (animationDone == true) {
48
- animationDone = false
49
- if (tabs.css('left') == '0px') {
50
- tabs.animate(
51
- {
52
- left: '-=' + width
53
- },
54
- 400,
55
- function () {
56
- animationDone = true
57
- }
58
- )
59
- } else {
60
- tabs.animate(
61
- {
62
- left: '+=' + width
63
- },
64
- 400,
65
- function () {
66
- animationDone = true
67
- }
68
- )
69
- }
3
+ // right filter sidebar
4
+ const sidebar = document.querySelector('#sidebar')
5
+ if (sidebar) {
6
+ sidebar.addEventListener('click', event => {
7
+ const insideSection = document.querySelector('#filters_sidebar_section')
8
+ if (!(event.target === insideSection || insideSection.contains(event.target))) {
9
+ sidebar.classList.toggle('sidebar_open')
70
10
  }
11
+ })
12
+ }
13
+
14
+ const menuButton = document.querySelector('#utility_nav')
15
+ const menu = document.querySelector('#tabs')
16
+
17
+ // toggle menu sidebar with the menu button
18
+ menuButton.addEventListener('click', event => {
19
+ const currentUser = document.querySelector('#current_user')
20
+ const logout = document.querySelector('#logout')
21
+ const forbiddenLinks = event.target === logout ||
22
+ logout.contains(event.target) ||
23
+ event.target === currentUser ||
24
+ currentUser.contains(event.target)
25
+ if (!forbiddenLinks) {
26
+ menu.classList.toggle('tabs_open')
71
27
  }
72
28
  })
73
29
 
74
- $(document).on('click touchstart', 'body', function (e) {
75
- var tabs = $('#tabs')
76
- var width = (tabs.length==0)? 0 : Math.round(tabs[0].getBoundingClientRect().width)
77
- if (tabs.css('left') == '0px') {
78
- if (e.pageX > width && e.pageY > 60) {
79
- if (animationDone == true) {
80
- animationDone = false
81
- tabs.animate(
82
- {
83
- left: '-=' + width
84
- },
85
- 400,
86
- function () {
87
- animationDone = true
88
- }
89
- )
90
- }
91
- }
30
+ // close left menu sidebar on any click outside
31
+ document.body.addEventListener('click', event => {
32
+ const forbiddenLinks = event.target === menu ||
33
+ menu.contains(event.target) ||
34
+ event.target === menuButton ||
35
+ menuButton.contains(event.target)
36
+ if (menu.classList.contains('tabs_open') && !forbiddenLinks) {
37
+ menu.classList.remove('tabs_open')
92
38
  }
93
39
  })
94
40
 
95
- $(document).on('click', '#tabs .has_nested', function (e) {
96
- e.stopPropagation()
97
- $(this).toggleClass('open')
98
- })
41
+ // toggle of nested menu items
42
+ const nestedMenuItem = document.querySelector('#tabs .has_nested')
43
+ if (nestedMenuItem) {
44
+ nestedMenuItem.addEventListener('click', (e) => {
45
+ e.stopPropagation()
46
+ nestedMenuItem.classList.toggle('open')
47
+ })
48
+ }
49
+
99
50
  })
@@ -49,6 +49,11 @@
49
49
  .filter_date_range input {
50
50
  width: 45%;
51
51
  display: inline-block;
52
+
53
+ // consistent look of all filters
54
+ &:nth-child(2) {
55
+ float: right;
56
+ }
52
57
  }
53
58
 
54
59
  input[type="submit"] {
@@ -56,9 +61,21 @@
56
61
  line-height: 31px;
57
62
  margin-right: 10px;
58
63
  }
64
+
65
+ &.panel {
66
+ position: relative;
67
+ }
59
68
  }
60
69
 
61
70
  #search-status-_sidebar_section {
62
71
  font-size: 14px;
63
72
  }
64
- }
73
+
74
+ // 'Filter' and 'Clear Filters' buttons
75
+ .buttons {
76
+ display: flex;
77
+ justify-content: space-between;
78
+ align-items: center;
79
+ margin-top: 1rem;
80
+ }
81
+ }
@@ -8,6 +8,12 @@
8
8
  z-index: 1;
9
9
  overflow: auto;
10
10
  left: - $header-width;
11
+ transition: .5s;
12
+ transition-timing-function: ease-in-out;
13
+
14
+ &.tabs_open {
15
+ left: 0;
16
+ }
11
17
 
12
18
  @media screen and (min-width: $sm-width) {
13
19
  top: 60px;
@@ -94,8 +94,14 @@ body.index {
94
94
 
95
95
  #sidebar {
96
96
  position: fixed;
97
+ transition: .5s;
98
+ transition-timing-function: ease-in-out;
97
99
  right: - $filter-width;
98
100
 
101
+ &.sidebar_open {
102
+ right: 0;
103
+ }
104
+
99
105
  @media screen and (min-width: $x-lg-width) {
100
106
  right: - $lg-filter-width;
101
107
  }
@@ -1,3 +1,3 @@
1
1
  module ArcticAdmin
2
- VERSION = "3.2.1"
2
+ VERSION = "4.0.0.alpha"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arctic_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 4.0.0.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clément Prod'homme
@@ -58,20 +58,6 @@ dependencies:
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.0'
61
- - !ruby/object:Gem::Dependency
62
- name: jquery-rails
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '0'
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '0'
75
61
  - !ruby/object:Gem::Dependency
76
62
  name: font-awesome-sass
77
63
  requirement: !ruby/object:Gem::Requirement
@@ -168,9 +154,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
154
  version: '0'
169
155
  required_rubygems_version: !ruby/object:Gem::Requirement
170
156
  requirements:
171
- - - ">="
157
+ - - ">"
172
158
  - !ruby/object:Gem::Version
173
- version: '0'
159
+ version: 1.3.1
174
160
  requirements: []
175
161
  rubygems_version: 3.0.3
176
162
  signing_key: