diff --git a/dist/nz-tour.css b/dist/nz-tour.css index 69f0e2a..3846cc6 100755 --- a/dist/nz-tour.css +++ b/dist/nz-tour.css @@ -23,7 +23,7 @@ nz-tour #nzTour-box-wrap { nz-tour #nzTour-box { width: 250px; min-height: 69px; - max-height: 120px; + max-height: 500px; padding: 0.5em; background: #fff; -webkit-box-shadow: 0 6px 19px 2px rgba(0,0,0,0.14); @@ -182,7 +182,7 @@ nz-tour #nzTour-content { height: 100%; max-height: 104px; overflow-x: hidden; - overflow-y: scroll; + overflow-y: auto; position: relative; border-bottom: solid 32px transparent; -webkit-box-shadow: inset 0 -20px 20px -20px rgba(0,0,0,0.2); diff --git a/dist/nz-tour.js b/dist/nz-tour.js index 0be9243..4b046f8 100755 --- a/dist/nz-tour.js +++ b/dist/nz-tour.js @@ -24,7 +24,9 @@ finishText: 'Finish', animationDuration: 400, placementPriority: ['bottom', 'right', 'top', 'left'], - disableHotkeys: false + disableHotkeys: false, + showPrevious: true, + showNext: true }, current: false, body: angular.element('body'), @@ -263,8 +265,8 @@ '
', ' ', '
', - ' ', - ' ', + ' ', + ' ', '
', ' ', '', @@ -391,9 +393,11 @@ prevent(e); return; case 27: - $scope.stop(); - prevent(e); - return; + if (!config.disableEscExit) { + $scope.stop(); + prevent(e); + return; + } case 38: case 40: onWindowScrollDebounced(); @@ -482,7 +486,9 @@ step: step, length: steps.length, previousText: config.previousText, - nextText: step == steps.length - 1 ? config.finishText : config.nextText + nextText: step == steps.length - 1 ? config.finishText : config.nextText, + showNext: steps[step].showNext === undefined ? config.showNext : steps[step].showNext, + showPrevious: steps[step].showPrevious === undefined ? config.showPrevious : steps[step].showPrevious }; //Don't mess around with angular sanitize for now. Add compile and sanitize later... els.innerContent.html(steps[step].content); diff --git a/dist/nz-tour.min.css b/dist/nz-tour.min.css index 21b5241..e90c036 100755 --- a/dist/nz-tour.min.css +++ b/dist/nz-tour.min.css @@ -1 +1 @@ -nz-tour *{-webkit-box-sizing:border-box;box-sizing:border-box}nz-tour.hidden #nzTour-box{-webkit-transform:scale(0);transform:scale(0)}nz-tour.hidden .nzTour-masks .mask{opacity:0;}nz-tour #nzTour-box-wrap{position:fixed;width:auto;height:auto;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block;z-index:999999999999}nz-tour #nzTour-box{width:250px;min-height:69px;max-height:120px;padding:.5em;background:#fff;-webkit-box-shadow:0 6px 19px 2px rgba(0,0,0,0.14);box-shadow:0 6px 19px 2px rgba(0,0,0,0.14);-webkit-border-radius:2px;border-radius:2px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;-webkit-transform:scale(1);transform:scale(1);}nz-tour #nzTour-box.dark-box{background:rgba(0,0,0,0.8);color:#fff;}nz-tour #nzTour-box.dark-box #nzTour-close{background:rgba(255,255,255,0.81);color:#000;}nz-tour #nzTour-box.dark-box #nzTour-close:hover{background:#ee342f;color:#fff}nz-tour #nzTour-box.dark-box #nzTour-step{background:#fff;color:rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-length{background:rgba(255,255,255,0.2);color:#bababa}nz-tour #nzTour-box.dark-box #nzTour-tip.left{left:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.center{left:50%}nz-tour #nzTour-box.dark-box #nzTour-tip.right{right:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.side.center{top:50%}nz-tour #nzTour-box.dark-box #nzTour-tip.side.top{top:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.side.bottom{bottom:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.top{top:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-tip.bottom{bottom:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-tip.side.left{left:-10px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-tip.side.right{right:-10px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-tip{position:absolute;display:block;width:0;height:0;}nz-tour #nzTour-tip.hidden{opacity:0;}nz-tour #nzTour-tip.vertical.left{left:5px}nz-tour #nzTour-tip.vertical.center{left:50%}nz-tour #nzTour-tip.vertical.right{right:5px}nz-tour #nzTour-tip.vertical.top{top:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #fff}nz-tour #nzTour-tip.vertical.bottom{bottom:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #fff}nz-tour #nzTour-tip.horizontal.top{top:5px}nz-tour #nzTour-tip.horizontal.center{top:50%}nz-tour #nzTour-tip.horizontal.bottom{bottom:5px}nz-tour #nzTour-tip.horizontal.left{left:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #fff}nz-tour #nzTour-tip.horizontal.right{right:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #fff}nz-tour #nzTour-close{position:absolute;top:-7px;right:-7px;width:14px;height:14px;background:rgba(0,0,0,0.8);-webkit-border-radius:100%;border-radius:100%;font-size:8px;color:#fff;cursor:pointer;-webkit-transition:all 0.2s ease;transition:all 0.2s ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;}nz-tour #nzTour-close:hover{background:#ec1d18}nz-tour #nzTour-content{width:100%;height:100%;max-height:104px;overflow-x:hidden;overflow-y:scroll;position:relative;border-bottom:solid 32px transparent;-webkit-box-shadow:inset 0 -20px 20px -20px rgba(0,0,0,0.2);box-shadow:inset 0 -20px 20px -20px rgba(0,0,0,0.2);padding:0 4px;font-size:14px}nz-tour #nzTour-step,nz-tour #nzTour-length{width:24px;height:24px;color:#fff;position:absolute;bottom:.7em;font-size:12px;font-weight:bold;-webkit-border-radius:50px;border-radius:50px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}nz-tour #nzTour-step{background:rgba(0,0,0,0.7);left:.7em;z-index:1}nz-tour #nzTour-length{background:#ccc;left:2.2em;z-index:0}nz-tour #nzTour-actions{position:absolute;bottom:.5em;right:.5em;height:24px;}nz-tour #nzTour-actions button{height:100%;border:none;-webkit-border-radius:2px;border-radius:2px;font-size:.75em;padding:4px 7px;color:#fff;background-color:#868686;}nz-tour #nzTour-actions button:hover{background-color:#6b6b6b}nz-tour #nzTour-actions button[disabled]{opacity:.2;}nz-tour #nzTour-actions button[disabled]:hover{opacity:.2;}nz-tour #nzTour-actions button:focus,nz-tour #nzTour-actions button:focus:active{outline:none}nz-tour #nzTour-actions button.success{background-color:#60bd68;}nz-tour #nzTour-actions button.success:hover{background-color:#43a14b}nz-tour #nzTour-actions button.danger{background-color:#ec1d18;}nz-tour #nzTour-actions button.danger:hover{background-color:#c01410}nz-tour #nzTour-previous{margin-right:.5em}nz-tour .nzTour-masks .mask{position:fixed;z-index:99999999;}nz-tour .nzTour-masks .mask.top,nz-tour .nzTour-masks .mask.bottom{width:100%;height:0;left:0}nz-tour .nzTour-masks .mask.left,nz-tour .nzTour-masks .mask.right{width:0;height:100%;top:0}nz-tour .nzTour-masks .mask.top{top:0}nz-tour .nzTour-masks .mask.bottom{bottom:0}nz-tour .nzTour-masks .mask.left{left:0}nz-tour .nzTour-masks .mask.right{right:0} \ No newline at end of file +nz-tour *{-webkit-box-sizing:border-box;box-sizing:border-box}nz-tour.hidden #nzTour-box{-webkit-transform:scale(0);transform:scale(0)}nz-tour.hidden .nzTour-masks .mask{opacity:0;}nz-tour #nzTour-box-wrap{position:fixed;width:auto;height:auto;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block;z-index:999999999999}nz-tour #nzTour-box{width:250px;min-height:69px;max-height:500px;padding:.5em;background:#fff;-webkit-box-shadow:0 6px 19px 2px rgba(0,0,0,0.14);box-shadow:0 6px 19px 2px rgba(0,0,0,0.14);-webkit-border-radius:2px;border-radius:2px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;-webkit-transform:scale(1);transform:scale(1);}nz-tour #nzTour-box.dark-box{background:rgba(0,0,0,0.8);color:#fff;}nz-tour #nzTour-box.dark-box #nzTour-close{background:rgba(255,255,255,0.81);color:#000;}nz-tour #nzTour-box.dark-box #nzTour-close:hover{background:#ee342f;color:#fff}nz-tour #nzTour-box.dark-box #nzTour-step{background:#fff;color:rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-length{background:rgba(255,255,255,0.2);color:#bababa}nz-tour #nzTour-box.dark-box #nzTour-tip.left{left:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.center{left:50%}nz-tour #nzTour-box.dark-box #nzTour-tip.right{right:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.side.center{top:50%}nz-tour #nzTour-box.dark-box #nzTour-tip.side.top{top:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.side.bottom{bottom:5px}nz-tour #nzTour-box.dark-box #nzTour-tip.top{top:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-tip.bottom{bottom:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-tip.side.left{left:-10px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-box.dark-box #nzTour-tip.side.right{right:-10px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid rgba(0,0,0,0.8)}nz-tour #nzTour-tip{position:absolute;display:block;width:0;height:0;}nz-tour #nzTour-tip.hidden{opacity:0;}nz-tour #nzTour-tip.vertical.left{left:5px}nz-tour #nzTour-tip.vertical.center{left:50%}nz-tour #nzTour-tip.vertical.right{right:5px}nz-tour #nzTour-tip.vertical.top{top:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #fff}nz-tour #nzTour-tip.vertical.bottom{bottom:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #fff}nz-tour #nzTour-tip.horizontal.top{top:5px}nz-tour #nzTour-tip.horizontal.center{top:50%}nz-tour #nzTour-tip.horizontal.bottom{bottom:5px}nz-tour #nzTour-tip.horizontal.left{left:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #fff}nz-tour #nzTour-tip.horizontal.right{right:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #fff}nz-tour #nzTour-close{position:absolute;top:-7px;right:-7px;width:14px;height:14px;background:rgba(0,0,0,0.8);-webkit-border-radius:100%;border-radius:100%;font-size:8px;color:#fff;cursor:pointer;-webkit-transition:all 0.2s ease;transition:all 0.2s ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;}nz-tour #nzTour-close:hover{background:#ec1d18}nz-tour #nzTour-content{width:100%;height:100%;max-height:104px;overflow-x:hidden;overflow-y:auto;position:relative;border-bottom:solid 32px transparent;-webkit-box-shadow:inset 0 -20px 20px -20px rgba(0,0,0,0.2);box-shadow:inset 0 -20px 20px -20px rgba(0,0,0,0.2);padding:0 4px;font-size:14px}nz-tour #nzTour-step,nz-tour #nzTour-length{width:24px;height:24px;color:#fff;position:absolute;bottom:.7em;font-size:12px;font-weight:bold;-webkit-border-radius:50px;border-radius:50px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}nz-tour #nzTour-step{background:rgba(0,0,0,0.7);left:.7em;z-index:1}nz-tour #nzTour-length{background:#ccc;left:2.2em;z-index:0}nz-tour #nzTour-actions{position:absolute;bottom:.5em;right:.5em;height:24px;}nz-tour #nzTour-actions button{height:100%;border:none;-webkit-border-radius:2px;border-radius:2px;font-size:.75em;padding:4px 7px;color:#fff;background-color:#868686;}nz-tour #nzTour-actions button:hover{background-color:#6b6b6b}nz-tour #nzTour-actions button[disabled]{opacity:.2;}nz-tour #nzTour-actions button[disabled]:hover{opacity:.2;}nz-tour #nzTour-actions button:focus,nz-tour #nzTour-actions button:focus:active{outline:none}nz-tour #nzTour-actions button.success{background-color:#60bd68;}nz-tour #nzTour-actions button.success:hover{background-color:#43a14b}nz-tour #nzTour-actions button.danger{background-color:#ec1d18;}nz-tour #nzTour-actions button.danger:hover{background-color:#c01410}nz-tour #nzTour-previous{margin-right:.5em}nz-tour .nzTour-masks .mask{position:fixed;z-index:99999999;}nz-tour .nzTour-masks .mask.top,nz-tour .nzTour-masks .mask.bottom{width:100%;height:0;left:0}nz-tour .nzTour-masks .mask.left,nz-tour .nzTour-masks .mask.right{width:0;height:100%;top:0}nz-tour .nzTour-masks .mask.top{top:0}nz-tour .nzTour-masks .mask.bottom{bottom:0}nz-tour .nzTour-masks .mask.left{left:0}nz-tour .nzTour-masks .mask.right{right:0} \ No newline at end of file diff --git a/dist/nz-tour.min.js b/dist/nz-tour.min.js index 85e76a2..5cb7d93 100644 --- a/dist/nz-tour.min.js +++ b/dist/nz-tour.min.js @@ -1 +1 @@ -!function(){function t(e){return angular.forEach(arguments,function(o){o!==e&&angular.forEach(o,function(o,r){e[r]&&e[r].constructor&&e[r].constructor===Object?t(e[r],o):e[r]=o})}),e}function e(t,e,o,n){t[_removeEventListener](a+e,"wheel"==s?o:r,n||!1)}function o(t,e,o,n){t[i](a+e,"wheel"==s?o:r,n||!1)}function r(t){!t&&(t=window.event);var e={originalEvent:t,target:t.target||t.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==t.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){t.preventDefault?t.preventDefault():t.returnValue=!1}};return"mousewheel"==s?(e.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(e.deltaX=-1/40*t.wheelDeltaX)):e.deltaY=t.detail,callback(e)}var n=angular.module("nzTour",[]);if(n.factory("nzTour",["$q","$rootScope","$compile","$timeout",function(e,o,r,n){function i(t){return t||e.reject("No Tour Specified!"),t.steps.length||e.reject("No steps were found in that tour!"),T.current?s().then(function(){return u(t)}):u(t)}function s(){return m(0).then(function(){return g(!1)}).then(function(){return T.current.promise.reject(),T.current=!1,!0})}function a(){T.current&&x()}function l(){return T.current||T.current.reject(),m(1).then(w).then(function(){return T.current.step++,1}).then(h)}function f(){return m(-1).then(function(){return T.current.step>0?(T.current.step--,-1):e.reject(null)}).then(h)}function c(t){return t>0&&t<=T.current.tour.steps.length?m(0).then(function(){return T.current.step=t-1,0}).then(h):e.reject("Requested step not defined")}function u(o){o.config=t({},T.config,o.config);var r=function(t){if(!angular.isArray(t))return!1;for(var e=0;e