Skip to content

Commit 816c70f

Browse files
New html5 data attributes: data-wheelnav-rotateoff, data-wheelnav-spreaderradius, data-wheelnav-spreaderpath, data-wheelnav-markerpath
1 parent 40b3765 commit 816c70f

11 files changed

+129
-58
lines changed

js/dist/core/wheelnav.js

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -476,21 +476,26 @@ wheelnav.prototype.parseWheel = function (holderDiv) {
476476
this.slicePathFunction = slicePath()[wheelnavSlicepath];
477477
}
478478
}
479-
//data-wheelnav-wheelradius
480-
var wheelnavWheelradius = holderDiv.getAttribute("data-wheelnav-wheelradius");
481-
if (wheelnavWheelradius !== null) {
482-
this.wheelRadius = Number(wheelnavWheelradius);
483-
}
484479
//data-wheelnav-colors
485480
var wheelnavColors = holderDiv.getAttribute("data-wheelnav-colors");
486481
if (wheelnavColors !== null) {
487482
this.colors = wheelnavColors.split(',');
488483
}
484+
//data-wheelnav-wheelradius
485+
var wheelnavWheelradius = holderDiv.getAttribute("data-wheelnav-wheelradius");
486+
if (wheelnavWheelradius !== null) {
487+
this.wheelRadius = Number(wheelnavWheelradius);
488+
}
489489
//data-wheelnav-navangle
490490
var wheelnavNavangle = holderDiv.getAttribute("data-wheelnav-navangle");
491491
if (wheelnavNavangle !== null) {
492492
this.navAngle = Number(wheelnavNavangle);
493493
}
494+
//data-wheelnav-rotateoff
495+
var wheelnavRotateOff = holderDiv.getAttribute("data-wheelnav-rotateoff");
496+
if (wheelnavRotateOff !== null) {
497+
this.clickModeRotate = false;
498+
}
494499
//data-wheelnav-cssmode
495500
var wheelnavCssmode = holderDiv.getAttribute("data-wheelnav-cssmode");
496501
if (wheelnavCssmode !== null) {
@@ -501,11 +506,30 @@ wheelnav.prototype.parseWheel = function (holderDiv) {
501506
if (wheelnavSpreader !== null) {
502507
this.spreaderEnable = true;
503508
}
509+
//data-wheelnav-spreaderradius
510+
var wheelnavSpreaderRadius = holderDiv.getAttribute("data-wheelnav-spreaderradius");
511+
if (wheelnavSpreaderRadius !== null) {
512+
this.spreaderRadius = Number(wheelnavSpreaderRadius);
513+
}
514+
//data-wheelnav-spreaderpath
515+
var wheelnavSpreaderPath = holderDiv.getAttribute("data-wheelnav-spreaderpath");
516+
if (wheelnavSpreaderPath !== null) {
517+
if (markerPath()[wheelnavSpreaderPath] !== undefined) {
518+
this.spreaderPathFunction = spreaderPath()[wheelnavSpreaderPath];
519+
}
520+
}
504521
//data-wheelnav-marker
505522
var wheelnavMarker = holderDiv.getAttribute("data-wheelnav-marker");
506523
if (wheelnavMarker !== null) {
507524
this.markerEnable = true;
508525
}
526+
//data-wheelnav-markerpath
527+
var wheelnavMarkerPath = holderDiv.getAttribute("data-wheelnav-markerpath");
528+
if (wheelnavMarkerPath !== null) {
529+
if (markerPath()[wheelnavMarkerPath] !== undefined) {
530+
this.markerPathFunction = markerPath()[wheelnavMarkerPath];
531+
}
532+
}
509533
//data-wheelnav-onlyinit
510534
var wheelnavOnlyinit = holderDiv.getAttribute("data-wheelnav-onlyinit");
511535
if (wheelnavOnlyinit !== null) {
@@ -1974,22 +1998,22 @@ spreader = function (wheelnav) {
19741998

19751999
//Set titles
19762000
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderInTitle)) {
1977-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
1978-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
2001+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
2002+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
19792003
}
19802004
else {
1981-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
1982-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
2005+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
2006+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
19832007
}
19842008

19852009
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderOutTitle)) {
1986-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
1987-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
2010+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
2011+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
19882012
this.spreaderTitle = thisWheelNav.raphael.path(this.outTitle.path);
19892013
}
19902014
else {
1991-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
1992-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
2015+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
2016+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
19932017
this.spreaderTitle = thisWheelNav.raphael.text(currentPath.titlePosX, currentPath.titlePosY, this.outTitle.title);
19942018
}
19952019

@@ -2434,7 +2458,7 @@ marker.prototype.setCurrentTransform = function (navAngle) {
24342458

24352459
///#source 1 1 /js/source/marker/wheelnav.markerPathStart.js
24362460
/* ======================================================================================= */
2437-
/* Spreader path definitions. */
2461+
/* Marker path definitions. */
24382462
/* ======================================================================================= */
24392463

24402464
markerPath = function () {

js/dist/core/wheelnav.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.

js/dist/core/wheelnav.min.js.map

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

js/dist/wheelnav.js

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -476,21 +476,26 @@ wheelnav.prototype.parseWheel = function (holderDiv) {
476476
this.slicePathFunction = slicePath()[wheelnavSlicepath];
477477
}
478478
}
479-
//data-wheelnav-wheelradius
480-
var wheelnavWheelradius = holderDiv.getAttribute("data-wheelnav-wheelradius");
481-
if (wheelnavWheelradius !== null) {
482-
this.wheelRadius = Number(wheelnavWheelradius);
483-
}
484479
//data-wheelnav-colors
485480
var wheelnavColors = holderDiv.getAttribute("data-wheelnav-colors");
486481
if (wheelnavColors !== null) {
487482
this.colors = wheelnavColors.split(',');
488483
}
484+
//data-wheelnav-wheelradius
485+
var wheelnavWheelradius = holderDiv.getAttribute("data-wheelnav-wheelradius");
486+
if (wheelnavWheelradius !== null) {
487+
this.wheelRadius = Number(wheelnavWheelradius);
488+
}
489489
//data-wheelnav-navangle
490490
var wheelnavNavangle = holderDiv.getAttribute("data-wheelnav-navangle");
491491
if (wheelnavNavangle !== null) {
492492
this.navAngle = Number(wheelnavNavangle);
493493
}
494+
//data-wheelnav-rotateoff
495+
var wheelnavRotateOff = holderDiv.getAttribute("data-wheelnav-rotateoff");
496+
if (wheelnavRotateOff !== null) {
497+
this.clickModeRotate = false;
498+
}
494499
//data-wheelnav-cssmode
495500
var wheelnavCssmode = holderDiv.getAttribute("data-wheelnav-cssmode");
496501
if (wheelnavCssmode !== null) {
@@ -501,11 +506,30 @@ wheelnav.prototype.parseWheel = function (holderDiv) {
501506
if (wheelnavSpreader !== null) {
502507
this.spreaderEnable = true;
503508
}
509+
//data-wheelnav-spreaderradius
510+
var wheelnavSpreaderRadius = holderDiv.getAttribute("data-wheelnav-spreaderradius");
511+
if (wheelnavSpreaderRadius !== null) {
512+
this.spreaderRadius = Number(wheelnavSpreaderRadius);
513+
}
514+
//data-wheelnav-spreaderpath
515+
var wheelnavSpreaderPath = holderDiv.getAttribute("data-wheelnav-spreaderpath");
516+
if (wheelnavSpreaderPath !== null) {
517+
if (markerPath()[wheelnavSpreaderPath] !== undefined) {
518+
this.spreaderPathFunction = spreaderPath()[wheelnavSpreaderPath];
519+
}
520+
}
504521
//data-wheelnav-marker
505522
var wheelnavMarker = holderDiv.getAttribute("data-wheelnav-marker");
506523
if (wheelnavMarker !== null) {
507524
this.markerEnable = true;
508525
}
526+
//data-wheelnav-markerpath
527+
var wheelnavMarkerPath = holderDiv.getAttribute("data-wheelnav-markerpath");
528+
if (wheelnavMarkerPath !== null) {
529+
if (markerPath()[wheelnavMarkerPath] !== undefined) {
530+
this.markerPathFunction = markerPath()[wheelnavMarkerPath];
531+
}
532+
}
509533
//data-wheelnav-onlyinit
510534
var wheelnavOnlyinit = holderDiv.getAttribute("data-wheelnav-onlyinit");
511535
if (wheelnavOnlyinit !== null) {
@@ -2725,22 +2749,22 @@ spreader = function (wheelnav) {
27252749

27262750
//Set titles
27272751
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderInTitle)) {
2728-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
2729-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
2752+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
2753+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
27302754
}
27312755
else {
2732-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
2733-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
2756+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
2757+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
27342758
}
27352759

27362760
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderOutTitle)) {
2737-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
2738-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
2761+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
2762+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
27392763
this.spreaderTitle = thisWheelNav.raphael.path(this.outTitle.path);
27402764
}
27412765
else {
2742-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
2743-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
2766+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
2767+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
27442768
this.spreaderTitle = thisWheelNav.raphael.text(currentPath.titlePosX, currentPath.titlePosY, this.outTitle.title);
27452769
}
27462770

@@ -3185,7 +3209,7 @@ marker.prototype.setCurrentTransform = function (navAngle) {
31853209

31863210
///#source 1 1 /js/source/marker/wheelnav.markerPathStart.js
31873211
/* ======================================================================================= */
3188-
/* Spreader path definitions. */
3212+
/* Marker path definitions. */
31893213
/* ======================================================================================= */
31903214

31913215
markerPath = function () {

js/dist/wheelnav.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.

js/dist/wheelnav.min.js.map

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

js/source/marker/wheelnav.marker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ marker.prototype.setCurrentTransform = function (navAngle) {
7373

7474
///#source 1 1 /js/source/marker/wheelnav.markerPathStart.js
7575
/* ======================================================================================= */
76-
/* Spreader path definitions. */
76+
/* Marker path definitions. */
7777
/* ======================================================================================= */
7878

7979
markerPath = function () {

js/source/marker/wheelnav.markerPathStart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ======================================================================================= */
2-
/* Spreader path definitions. */
2+
/* Marker path definitions. */
33
/* ======================================================================================= */
44

55
markerPath = function () {

js/source/spreader/wheelnav.spreader.core.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ spreader = function (wheelnav) {
4747

4848
//Set titles
4949
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderInTitle)) {
50-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
51-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
50+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
51+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
5252
}
5353
else {
54-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
55-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
54+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
55+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
5656
}
5757

5858
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderOutTitle)) {
59-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
60-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
59+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
60+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
6161
this.spreaderTitle = thisWheelNav.raphael.path(this.outTitle.path);
6262
}
6363
else {
64-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
65-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
64+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
65+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
6666
this.spreaderTitle = thisWheelNav.raphael.text(currentPath.titlePosX, currentPath.titlePosY, this.outTitle.title);
6767
}
6868

@@ -83,7 +83,6 @@ spreader = function (wheelnav) {
8383
spreader.prototype.setCurrentTransform = function () {
8484
if (this.wheelnav.spreaderEnable) {
8585
this.spreaderPath.toFront();
86-
8786

8887
if (this.wheelnav.currentPercent > this.wheelnav.minPercent) {
8988
currentPath = this.spreaderPathOut.spreaderPathString;

js/source/spreader/wheelnav.spreader.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ spreader = function (wheelnav) {
4848

4949
//Set titles
5050
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderInTitle)) {
51-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
52-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
51+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle, this.wheelnav.raphael.raphael);
52+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
5353
}
5454
else {
55-
onTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
56-
this.inTitle = onTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
55+
inTitle = new wheelnavTitle(this.wheelnav.spreaderInTitle);
56+
this.inTitle = inTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
5757
}
5858

5959
if (wheelnavTitle().isPathTitle(this.wheelnav.spreaderOutTitle)) {
60-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
61-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
60+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle, this.wheelnav.raphael.raphael);
61+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
6262
this.spreaderTitle = thisWheelNav.raphael.path(this.outTitle.path);
6363
}
6464
else {
65-
offTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
66-
this.outTitle = offTitle.getTitlePercentAttr(this.spreaderPathIn.titlePosX, this.spreaderPathIn.titlePosY);
65+
outTitle = new wheelnavTitle(this.wheelnav.spreaderOutTitle);
66+
this.outTitle = outTitle.getTitlePercentAttr(this.spreaderPathOut.titlePosX, this.spreaderPathOut.titlePosY);
6767
this.spreaderTitle = thisWheelNav.raphael.text(currentPath.titlePosX, currentPath.titlePosY, this.outTitle.title);
6868
}
6969

0 commit comments

Comments
 (0)