light_mobile 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: ba5fe720479eb1278887561b62912499cf74dfd4
4
- data.tar.gz: ce05176c4880db28a8b1d76682ab2b51d0a5572e
3
+ metadata.gz: 8e975439cc7c862945564e8bf42f939b4e509961
4
+ data.tar.gz: 5d1f69b93e2a5b4cdb4e6ea8b055be03a79ebf6a
5
5
  SHA512:
6
- metadata.gz: eaa19b5f3f849a06971068c4e085be9d82819435a0303c8709c9e2db9f16459826c891fb2eff8a7304dbb75d06c52038ef395ab09435f1dfe7faa9a1ef48cf1b
7
- data.tar.gz: 0c673c378f605bc969d6e863ae0b5e01c4238bbc519734d895d357e168a8e7c6bfc52fcf1fca6f0406b28c5cbb6ce86f7bd97381e9b3038ea7d80b60a6c62b38
6
+ metadata.gz: 584e76941b449fe931b12e0ec44fbc82095ea68a9c5ac7fa8bab0d91f77cbb12efb7833b1f0b388fc705b99754470739bc26770ac37fc025510caad9bdb1b30e
7
+ data.tar.gz: 41ea27f33ba97ee425f6204a87de032968edf49819a808c3792573b1d68e504e73f132b1711bac83bf553303419ea64ab916a92b08532f8df1b50e6c02e2882e
@@ -1,16 +1,24 @@
1
1
  $ ->
2
- $("table.mobile-tabs").each ->
3
- lightMobileInitTabs($(this))
2
+ # Initialize all tabs-elements.
3
+ $("table.mobile-tabs").each -> lightMobileInitTabs($(this))
4
+
5
+ # Refresh active tab on back-events.
6
+ $(window).on "hashchange", -> $("table.mobile-tabs").each -> lightMobileRefreshActiveTab($(this))
4
7
 
5
8
  lightMobileInitTabs = (tabs) ->
9
+ return if tabs.data("initialized") == "true"
10
+ tabs.data("initialized", "true")
11
+
6
12
  tds = $("tbody > tr > td", tabs)
13
+ tds.click (e) -> lightMobileActivateTab(tabs, $(this))
7
14
 
8
- tds.click (e) ->
9
- lightMobileActivateTab(tabs, $(this))
15
+ lightMobileRefreshActiveTab(tabs)
10
16
 
17
+ lightMobileRefreshActiveTab = (tabs) ->
11
18
  if match = location.hash.match(/^#mobile-tab-(.+)$/)
12
19
  mobile_tab_active = match[1]
13
20
 
21
+ tds = $("tbody > tr > td", tabs)
14
22
  tds.each ->
15
23
  tab = $(this)
16
24
  active_tab = false
@@ -28,16 +36,8 @@ lightMobileInitTabs = (tabs) ->
28
36
  container.addClass("mobile-tabs-container-active")
29
37
  else
30
38
  tab.removeClass("mobile-tab-active")
39
+ container.removeClass("mobile-tabs-container-active")
31
40
 
32
41
  lightMobileActivateTab = (tabs, tab) ->
33
- active_tab = $("> tbody > tr > td.mobile-tab-active", tabs)
34
- active_tab.removeClass("mobile-tab-active")
35
- tab.addClass("mobile-tab-active")
36
-
37
- active_container = $("#" + active_tab.data("tab"))
38
- active_container.removeClass("mobile-tabs-container-active")
39
-
40
- new_container = $("#" + tab.data("tab"))
41
- new_container.addClass("mobile-tabs-container-active")
42
-
42
+ # Changing the hash fires an event that updates the active tab.
43
43
  location.hash = "mobile-tab-" + tab.data("tab")
@@ -1,4 +1,4 @@
1
- input[type=text], input[type=password], input[type=tel], input[type=email], select, textarea {
1
+ input[type=text], input[type=password], input[type=tel], input[type=email], input[type=number], select, textarea {
2
2
  border: 1px solid #d5d6d6;
3
3
  border-radius: 10px;
4
4
  padding: 8px;
@@ -24,8 +24,22 @@ input[type=text], input[type=password], input[type=tel], input[type=email], sele
24
24
  width: 60px;
25
25
  }
26
26
 
27
- .input.date > select.date {
28
- width: 120px;
27
+ .input.date > select.date, .input.datetime > select.datetime {
28
+ &:nth-child(4) {
29
+ width: 70px;
30
+ }
31
+
32
+ &:nth-child(3) {
33
+ width: 110px;
34
+ }
35
+
36
+ &:nth-child(2) {
37
+ width: 60px;
38
+ }
39
+
40
+ &:nth-child(5), &:nth-child(6) {
41
+ width: 60px;
42
+ }
29
43
  }
30
44
 
31
45
  textarea {
@@ -12,7 +12,7 @@ table.mobile-tabs {
12
12
  border-right: none;
13
13
  background-color: #f6f6f6;
14
14
  list-style-type: none;
15
- padding: 10px;
15
+ padding: 9px;
16
16
  text-align: left;
17
17
  cursor: pointer;
18
18
  width: auto;
@@ -36,10 +36,10 @@ table.mobile-tabs {
36
36
  }
37
37
 
38
38
  > td.mobile-tab-icon {
39
- background-size: auto 75%;
39
+ background-size: auto 62%;
40
40
  background-repeat: no-repeat;
41
- background-position: 7px 5px;
42
- padding-left: 44px;
41
+ background-position: 7px 7px;
42
+ padding-left: 34px;
43
43
  }
44
44
  }
45
45
  }
@@ -1,3 +1,3 @@
1
1
  module LightMobile
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: light_mobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails