Skip to content

Commit

Permalink
Remove smartPlacement option since Popper handles it
Browse files Browse the repository at this point in the history
  • Loading branch information
sorich87 committed Oct 8, 2017
1 parent 755a26a commit 6a1028f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 31 deletions.
5 changes: 2 additions & 3 deletions build/js/bootstrap-tour-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -4030,7 +4030,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};

Tour.prototype._showPopover = function(step, i) {
var $element, $tip, isOrphan, options, shouldAddSmart;
var $element, $tip, isOrphan, options;
$(".tour-" + this._options.name).remove();
options = $.extend({}, this._options);
isOrphan = this._isOrphan(step);
Expand All @@ -4055,9 +4055,8 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};
})(this));
}
shouldAddSmart = step.smartPlacement === true && step.placement.search(/auto/i) === -1;
$element.popover({
placement: shouldAddSmart ? "auto " + step.placement : step.placement,
placement: step.placement,
trigger: 'manual',
title: step.title,
content: step.content,
Expand Down
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour-standalone.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions build/js/bootstrap-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};

Tour.prototype._showPopover = function(step, i) {
var $element, $tip, isOrphan, options, shouldAddSmart;
var $element, $tip, isOrphan, options;
$(".tour-" + this._options.name).remove();
options = $.extend({}, this._options);
isOrphan = this._isOrphan(step);
Expand All @@ -570,9 +570,8 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};
})(this));
}
shouldAddSmart = step.smartPlacement === true && step.placement.search(/auto/i) === -1;
$element.popover({
placement: shouldAddSmart ? "auto " + step.placement : step.placement,
placement: step.placement,
trigger: 'manual',
title: step.title,
content: step.content,
Expand Down
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour.min.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/coffee/bootstrap-tour.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,9 @@
.on "#{@_reflexEvent(step.reflex)}.tour-#{@_options.name}", =>
if @_isLast() then @next() else @end()

shouldAddSmart = step.smartPlacement is true and step.placement.search(/auto/i) is -1

$element
.popover(
placement: if shouldAddSmart then "auto #{step.placement}" else step.placement
placement: step.placement
trigger: 'manual'
title: step.title
content: step.content
Expand Down
14 changes: 0 additions & 14 deletions src/docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ <h3 id="tour-options">Global options</h3>
name: "tour",
steps: [],
container: "body",
smartPlacement: true,
keyboard: true,
storage: window.localStorage,
debug: false,
Expand Down Expand Up @@ -89,12 +88,6 @@ <h3 class='popover-title'></h3>
</td>
<td><code>'body'</code></td>
</tr>
<tr>
<td>smartPlacement</td>
<td>Boolean</td>
<td>It dynamically reorients the popover by default by specifying auto for the placement, every time.<br></td>
<td><code>true</code></td>
</tr>
<tr>
<td>autoscroll</td>
<td>Boolean</td>
Expand Down Expand Up @@ -338,7 +331,6 @@ <h3>Step Options</h3>
host: "",
element: "",
placement: "right",
smartPlacement: true,
title: "",
content: "",
next: 0,
Expand Down Expand Up @@ -410,12 +402,6 @@ <h3>Step Options</h3>
</td>
<td><code>'right'</code></td>
</tr>
<tr>
<td>smartPlacement</td>
<td>Boolean</td>
<td>It dynamically reorients the popover by default by specifying auto for the placement.</td>
<td><code>true</code></td>
</tr>
<tr>
<td>title</td>
<td>String|Function</td>
Expand Down
5 changes: 2 additions & 3 deletions src/docs/assets/js/bootstrap-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};

Tour.prototype._showPopover = function(step, i) {
var $element, $tip, isOrphan, options, shouldAddSmart;
var $element, $tip, isOrphan, options;
$(".tour-" + this._options.name).remove();
options = $.extend({}, this._options);
isOrphan = this._isOrphan(step);
Expand All @@ -570,9 +570,8 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};
})(this));
}
shouldAddSmart = step.smartPlacement === true && step.placement.search(/auto/i) === -1;
$element.popover({
placement: shouldAddSmart ? "auto " + step.placement : step.placement,
placement: step.placement,
trigger: 'manual',
title: step.title,
content: step.content,
Expand Down
5 changes: 2 additions & 3 deletions test/bootstrap-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};

Tour.prototype._showPopover = function(step, i) {
var $element, $tip, isOrphan, options, shouldAddSmart;
var $element, $tip, isOrphan, options;
$(".tour-" + this._options.name).remove();
options = $.extend({}, this._options);
isOrphan = this._isOrphan(step);
Expand All @@ -570,9 +570,8 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
};
})(this));
}
shouldAddSmart = step.smartPlacement === true && step.placement.search(/auto/i) === -1;
$element.popover({
placement: shouldAddSmart ? "auto " + step.placement : step.placement,
placement: step.placement,
trigger: 'manual',
title: step.title,
content: step.content,
Expand Down

0 comments on commit 6a1028f

Please sign in to comment.