Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
JS Call fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tavicu committed Oct 12, 2015
1 parent 1c53560 commit cd58620
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bootstrap-confirmation v1.0.3
# bootstrap-confirmation v1.0.4

This is a fork of ethaizone's [original code](https://github.com/ethaizone/Bootstrap-Confirmation)

Expand Down
24 changes: 14 additions & 10 deletions bootstrap-confirmation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*!
* Bootstrap Confirmation v1.0.4
* https://github.com/tavicu/bs-confirmation
*/
+function ($) {
'use strict';

Expand Down Expand Up @@ -68,7 +72,7 @@

if (!$.fn.popover || !$.fn.tooltip) throw new Error('Confirmation requires popover.js and tooltip.js');

Confirmation.VERSION = '1.0.3'
Confirmation.VERSION = '1.0.4'

Confirmation.DEFAULTS = $.extend({}, $.fn.popover.Constructor.DEFAULTS, {
placement : 'right',
Expand Down Expand Up @@ -154,64 +158,64 @@
var $e = this.$element;
var o = this.options;

return $e.attr('data-btnOkClass') || (typeof o.btnOkClass == 'function' ? o.btnOkClass.call($e[0]) : o.btnOkClass);
return $e.attr('data-btnOkClass') || (typeof o.btnOkClass == 'function' ? o.btnOkClass.call(this, $e[0]) : o.btnOkClass);
}

Confirmation.prototype.getBtnOkLabel = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-btnOkLabel') || (typeof o.btnOkLabel == 'function' ? o.btnOkLabel.call($e[0]) : o.btnOkLabel);
return $e.attr('data-btnOkLabel') || (typeof o.btnOkLabel == 'function' ? o.btnOkLabel.call(this, $e[0]) : o.btnOkLabel);
}

Confirmation.prototype.getBtnOkIcon = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-btnOkIcon') || (typeof o.btnOkIcon == 'function' ? o.btnOkIcon.call($e[0]) : o.btnOkIcon);
return $e.attr('data-btnOkIcon') || (typeof o.btnOkIcon == 'function' ? o.btnOkIcon.call(this, $e[0]) : o.btnOkIcon);
}

Confirmation.prototype.getBtnCancelClass = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-btnCancelClass') || (typeof o.btnCancelClass == 'function' ? o.btnCancelClass.call($e[0]) : o.btnCancelClass);
return $e.attr('data-btnCancelClass') || (typeof o.btnCancelClass == 'function' ? o.btnCancelClass.call(this, $e[0]) : o.btnCancelClass);
}

Confirmation.prototype.getBtnCancelLabel = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-btnCancelLabel') || (typeof o.btnCancelLabel == 'function' ? o.btnCancelLabel.call($e[0]) : o.btnCancelLabel);
return $e.attr('data-btnCancelLabel') || (typeof o.btnCancelLabel == 'function' ? o.btnCancelLabel.call(this, $e[0]) : o.btnCancelLabel);
}

Confirmation.prototype.getBtnCancelIcon = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-btnCancelIcon') || (typeof o.btnCancelIcon == 'function' ? o.btnCancelIcon.call($e[0]) : o.btnCancelIcon);
return $e.attr('data-btnCancelIcon') || (typeof o.btnCancelIcon == 'function' ? o.btnCancelIcon.call(this, $e[0]) : o.btnCancelIcon);
}

Confirmation.prototype.getHref = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-href') || (typeof o.href == 'function' ? o.href.call($e[0]) : o.href);
return $e.attr('data-href') || (typeof o.href == 'function' ? o.href.call(this, $e[0]) : o.href);
}

Confirmation.prototype.getTarget = function () {
var $e = this.$element;
var o = this.options;

return $e.attr('data-target') || (typeof o.target == 'function' ? o.target.call($e[0]) : o.target);
return $e.attr('data-target') || (typeof o.target == 'function' ? o.target.call(this, $e[0]) : o.target);
}

Confirmation.prototype.isPopout = function () {
var popout;
var $e = this.$element;
var o = this.options;

popout = $e.attr('data-popout') || (typeof o.popout == 'function' ? o.popout.call($e[0]) : o.popout);
popout = $e.attr('data-popout') || (typeof o.popout == 'function' ? o.popout.call(this, $e[0]) : o.popout);

if(popout == 'false') popout = false;

Expand Down
5 changes: 5 additions & 0 deletions bootstrap-confirmation.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bs-confirmation",
"version": "1.0.3",
"version": "1.0.4",
"main": "bootstrap-confirmation.js",
"keywords": [ "bootstrap", "confirm", "confirmation"],
"description": "Confirmation plugin compatible with Twitter Bootstrap 3 extending Popover",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["bootstrap", "bootstrap dialog", "bootstrap confirmation", "confirmation"],
"description": "Confirmation plugin compatible with Twitter Bootstrap 3 extending Popover",
"homepage": "https://github.com/tavicu/bs-confirmation",
"version": "1.0.3",
"version": "1.0.4",
"authors": [
{
"name": "Tavicu",
Expand Down
2 changes: 1 addition & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1>With callback functions</h1>

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<script src="bootstrap-confirmation.js"></script>
<script src="bootstrap-confirmation.min.js"></script>

<script>
$(function() {
Expand Down

0 comments on commit cd58620

Please sign in to comment.