redmine_extensions 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 83a259a0df79f133ef83c0d83a97867065e72ba53718b6021f4ea4f199350300
4
- data.tar.gz: 498ecf0ad2f97992ecb43b5e9f08af3e8d7dd6e73260b1bf6539e1cce8c7f21b
2
+ SHA1:
3
+ metadata.gz: 0f667f85e0d110624ccd5f899854088d8015fa00
4
+ data.tar.gz: c28815a63c4e04d663c7fd745d49e31ec82baf4f
5
5
  SHA512:
6
- metadata.gz: fadd35b5ab3c6ebfd7254b760ddbf17cd56a39fc3de03a673d15e7e2dda50ae83c4469a1e5f4d6264e87733284097d619c2181724021b8ebadf0f9d591f98f28
7
- data.tar.gz: e7a1aaca2e52ec55f08178b5526aae5f82d155582683359c4f853ee7d0c3d13c79603949371cc333310d14d0af939d35d990124093ecfdef3dfeb478568dd1ee
6
+ metadata.gz: ce9bceb329b3a207e46cbca65a3c96dc950219d928d919b3a7d06a07f08bff2a06f4798f23b1f553752cfd78a7b623d493e345fd59c908a03b28532da66f9969
7
+ data.tar.gz: 4cc55109bd400d1f256f35e4814187e8d7c1ca0f18f599d9a359528f0da77c6b103f3c27eb0fbcf5ad3af9b5233ec3a4004de437d27ac75354bdc035e5673562
@@ -3,23 +3,25 @@ window.EasyToggler = new function() {
3
3
  // Example:
4
4
  // localStorage # => {"easy-toggle-state": {myDiv: 0, history: 1}} # where myDiv is by default hidden, and now will be shown as visible and history is vice versa
5
5
 
6
- var storage = JSON.parse(localStorage.getItem('easy-toggle-state') || "{}");
6
+ const storage = JSON.parse(localStorage.getItem("easy-toggle-state") || "{}");
7
7
 
8
- var save = function() {
9
- localStorage.setItem('easy-toggle-state', JSON.stringify(storage));
8
+ const save = function() {
9
+ localStorage.setItem("easy-toggle-state", JSON.stringify(storage));
10
10
  return storage;
11
11
  };
12
12
 
13
- var isHidden = function(el) {
14
- return (el && el.style.display === 'none')
13
+ const isHidden = function (el) {
14
+ if (!el) return false;
15
+ const computedStyle = window.getComputedStyle(el);
16
+ return computedStyle.display === "none";
15
17
  };
16
18
 
17
- var toggle = function(el) {
18
- var parent = el.parentNode;
19
+ const toggle = function(el) {
20
+ const parent = el.parentNode;
19
21
 
20
22
  parent.classList.toggle("collapsed");
21
23
 
22
- el.style.display = isHidden(el) ? 'block' : 'none';
24
+ el.style.display = isHidden(el) ? "block" : "none";
23
25
  el.id && !!parent.dataset.toggle && save();
24
26
  $( document ).trigger( "erui_interface_change_vertical" ); // <> !#@!
25
27
  return el;
@@ -30,22 +32,16 @@ window.EasyToggler = new function() {
30
32
  if (event && event.target.tagName === "A")
31
33
  return;
32
34
 
33
- var el = (typeof(id_or_el) === "object") ? id_or_el : document.getElementById(id_or_el);
34
- var id = el.id;
35
- if (id) {
36
- if (!!storage[id]) {
37
- delete storage[id];
38
- } else {
39
- storage[id] = isHidden(el) ? 0 : 1;
40
- }
41
- }
35
+ const el = (typeof(id_or_el) === "object") ? id_or_el : document.getElementById(id_or_el);
36
+ const id = el.id;
37
+ if (id) storage[id] = isHidden(el) ? 0 : 1;
42
38
  toggle(el);
43
39
  };
44
40
 
45
41
  this.ensureToggle = function() {
46
- var list = document.querySelectorAll('*[data-toggle]');
47
- for (var i = 0; i < list.length; ++i) {
48
- var item = list.item(i);
42
+ const list = document.querySelectorAll("*[data-toggle]");
43
+ for (let i = 0; i < list.length; ++i) {
44
+ const item = list.item(i);
49
45
  window.EasyToggler.ensureToggleItem(item);
50
46
  }
51
47
  return this;
@@ -54,11 +50,12 @@ window.EasyToggler = new function() {
54
50
  /**
55
51
  * @param {HTMLElement} item
56
52
  */
57
- this.ensureToggleItem = function(item) {
58
- var container = document.getElementById(item.dataset.toggle);
59
- if (!!storage[item.dataset.toggle]) {
60
- toggle(container);
61
- }
53
+ this.ensureToggleItem = function (item) {
54
+ if (storage[item.dataset.toggle] == null) return;
55
+ const container = document.getElementById(item.dataset.toggle);
56
+ const containerState = isHidden(container);
57
+ const savedContainerState = !!storage[item.dataset.toggle];
58
+ if (containerState !== savedContainerState) toggle(container);
62
59
  return this;
63
60
  };
64
61
  };
@@ -1 +1 @@
1
- <h1><%%= link_to(@<%= model_name_underscored %>.to_s, @<%= model_name_underscored %>_url) %></h1>
1
+ <h1><%%= link_to(@<%= model_name_underscored %>.to_s, @<%= model_name_underscored %>_url) %></h1>
@@ -1,2 +1,2 @@
1
- <%%= @<%= model_name_underscored %>.to_s %>
2
- <%%= @<%= model_name_underscored %>_url %>
1
+ <%%= @<%= model_name_underscored %>.to_s %>
2
+ <%%= @<%= model_name_underscored %>_url %>
@@ -1,2 +1,2 @@
1
- <%%= @<%= model_name_underscored %>.to_s %>
2
- <%%= @<%= model_name_underscored %>_url %>
1
+ <%%= @<%= model_name_underscored %>.to_s %>
2
+ <%%= @<%= model_name_underscored %>_url %>
@@ -1,5 +1,5 @@
1
1
  module RedmineExtensions
2
2
 
3
- VERSION = '0.6.0'
3
+ VERSION = '0.6.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Easy Software Ltd
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-15 00:00:00.000000000 Z
11
+ date: 2022-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -175,7 +175,7 @@ homepage: https://www.easyredmine.com
175
175
  licenses:
176
176
  - GPL-2.0
177
177
  metadata: {}
178
- post_install_message:
178
+ post_install_message:
179
179
  rdoc_options: []
180
180
  require_paths:
181
181
  - lib
@@ -190,14 +190,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.3.9
194
- signing_key:
193
+ rubyforge_project:
194
+ rubygems_version: 2.6.7
195
+ signing_key:
195
196
  specification_version: 4
196
197
  summary: Redmine Extensions is set of useful features for Redmine. Main focus is on
197
198
  development helpers, but many users can find it helpfull
198
199
  test_files:
199
- - spec/spec_helper.rb
200
+ - spec/factories/easy_settings.rb
200
201
  - spec/init_rails.rb
201
202
  - spec/models/easy_setting_spec.rb
202
203
  - spec/presenters/easy_settings/params_wrapper_spec.rb
203
- - spec/factories/easy_settings.rb
204
+ - spec/spec_helper.rb