Skip to content

Commit 8dbc782

Browse files
committed
#2 - Prefer hash in pushState over full URL
#5 - Fix self/this typo causing hashChanges to fail Update dist Bump version
1 parent 81f5b28 commit 8dbc782

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

dist/jquery.hash-tabs.js

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.hash-tabs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hash-tabs",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Hash Tabs",
55
"keywords": [
66
"jquery-plugin"

src/jquery.hash-tabs.coffee

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@
159159
# fix for FF and Chrome not performing hash update on triggered click
160160
false if $(this)[0].href is "##{self.options.initialTabId?}" or $(this)[0].index is self.options.initialTabIndex
161161
targetHref = $(this)[0].href
162-
console.log "Pushed state #{targetHref}" if @options.debug is on
162+
targetHash = targetHref.split("#")[1]
163+
console.log "Pushed state #{targetHref}" if self.options.debug is on
163164
if window.history? and self.options.history is on
164-
history.pushState(self.options, "HashTabs", targetHref)
165-
else window.location.hash = targetHref.split("#")[1]
165+
history.pushState(self.options, "HashTabs", "##{targetHash}")
166+
else window.location.hash = targetHash
166167
false
167168
)
168169

src/jquery.hash-tabs.js

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)