Skip to content

Commit 77ecf6f

Browse files
committed
* added ability to add transcluyde to tip type of on boarding
* fixed bug where click to close on boarding would propagate to underlying item * small css changes
1 parent 02cc429 commit 77ecf6f

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

css/ng-walkthrough.css

+6-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@
9999

100100
.walkthrough-transclude{
101101
position: relative;
102-
z-index: 1001;
102+
z-index: 2;
103+
width: 100%;
104+
height: 100%;
103105
}
104106

105107
.walkthrough-hole-round{
@@ -121,12 +123,13 @@
121123
.walkthrough-container{
122124
float: left;
123125
position: relative;
124-
height: 100vh;
126+
height: 100%;
125127
width: 100%;
126128
}
127129

128130
.walkthrough-inner{
129-
position: absolute;
131+
position: fixed;
132+
z-index: 3;
130133
width: 100%;
131134
}
132135

ng-walkthrough.html

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
</div>
1717
</div>
1818
<div class="walkthrough-container walkthrough-container-tip" ng-show="walkthroughType=='tip'">
19+
<div class="walkthrough-transclude" ng-transclude></div>
1920
<div class="walkthrough-inner" ng-class="{'walkthrough-top': ((!forceCaptionLocation && !tipLocation) || forceCaptionLocation=='TOP' || tipLocation =='TOP'), 'walkthrough-bottom': (forceCaptionLocation=='BOTTOM' || tipLocation =='BOTTOM')}">
2021
<img class="walkthrough-element walkthrough-tip-icon-text-box" ng-class="{'walkthrough-tip-icon-image-front': tipIconLocation=='FRONT', 'walkthrough-tip-icon-image-back': tipIconLocation=='BACK'}" ng-show="icon!='arrow'" ng-src="{{icon}}" alt="icon">
2122
<button class="walkthrough-done-button walkthrough-tip-done-button-text-box" type="button" ng-if="useButton" ng-click="onCloseClicked($event)" on-touch="onCloseTouched($event)">

ng-walkthrough.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ angular.module('ng-walkthrough', [])
111111
if (scope.clickEvent == 'touch' && canTouch) { //We need this in case both angular an ionic are for some reason loaded
112112
if ((!scope.useButton) ||
113113
(e.currentTarget.className.indexOf(DOM_WALKTHROUGH_DONE_BUTTON_CLASS) > -1)) {
114-
scope.closeWalkthrough();
115114
canTouch = false;
116-
$timeout(function(){
117-
canTouch = true;
118-
}, 500);
115+
$timeout(function() {//This timeout added to avoid event propagation happening outside of directive bug
116+
scope.closeWalkthrough();
117+
$timeout(function () {
118+
canTouch = true;
119+
}, 500);
120+
}, 200);
119121
}
120122
}
121123
};
@@ -417,8 +419,8 @@ angular.module('ng-walkthrough', [])
417419
if (scope.isBindClickEventToBody){
418420
bindClickEvents();
419421
}
420-
if (!scope.hasTransclude){
421-
try {
422+
//if (!scope.hasTransclude){//remarked cause did not focus on search field in recipe select
423+
try {
422424
if (attrs.focusElementId) {
423425
scope.setFocusOnElement(attrs.focusElementId);
424426
}
@@ -431,7 +433,7 @@ angular.module('ng-walkthrough', [])
431433
scope.setFocusOnElement(attrs.focusElementId);
432434
}, 300);
433435
}
434-
}
436+
//}
435437
scope.onWalkthroughShow();
436438
} else{
437439
unbindScreenResize();

0 commit comments

Comments
 (0)