Skip to content

Commit

Permalink
Code patch for PR-88 and PR-86
Browse files Browse the repository at this point in the history
  • Loading branch information
nosir committed Aug 28, 2016
1 parent 0c274f9 commit 3963ad1
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"form",
"input"
],
"version": "0.6.14",
"version": "0.7.0",
"author": {
"name": "Max Huang",
"email": "[email protected]",
Expand Down
4 changes: 3 additions & 1 deletion dist/cleave-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Cleave.prototype = {
// external google closure lib
try {
pps.phoneFormatter = new Cleave.PhoneFormatter(
new window.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
pps.delimiter
);
} catch (ex) {
Expand Down Expand Up @@ -484,6 +484,8 @@ var DefaultProperties = {
target.blocks = opts.blocks || [];
target.blocksLength = target.blocks.length;

target.root = (typeof global === "object" && global) ? global : window;

target.maxLength = 0;

target.backspace = false;
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave-angular.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions dist/cleave-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ return /******/ (function(modules) { // webpackBootstrap
// Cleave.AsYouTypeFormatter should be provided by
// external google closure lib
try {
pps.phoneFormatter = new PhoneFormatter(new window.Cleave.AsYouTypeFormatter(pps.phoneRegionCode), pps.delimiter);
pps.phoneFormatter = new PhoneFormatter(new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode), pps.delimiter);
} catch (ex) {
throw new Error('Please include phone-type-formatter.{country}.js lib');
}
Expand Down Expand Up @@ -342,7 +342,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
});

module.exports = window.Cleave = Cleave;
module.exports = Cleave;

/***/ },
/* 1 */
Expand Down Expand Up @@ -854,7 +854,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 8 */
/***/ function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(module) {'use strict';
/* WEBPACK VAR INJECTION */(function(global, module) {'use strict';

/**
* Props Assignment
Expand Down Expand Up @@ -912,6 +912,8 @@ return /******/ (function(modules) { // webpackBootstrap
target.blocks = opts.blocks || [];
target.blocksLength = target.blocks.length;

target.root = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === "object" && global ? global : window;

target.maxLength = 0;

target.backspace = false;
Expand All @@ -924,7 +926,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (( false ? 'undefined' : _typeof(module)) === 'object' && _typeof(module.exports) === 'object') {
module.exports = exports = DefaultProperties;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)(module)))
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(3)(module)))

/***/ }
/******/ ])
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave-react.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dist/cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Cleave.prototype = {
// external google closure lib
try {
pps.phoneFormatter = new Cleave.PhoneFormatter(
new window.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
pps.delimiter
);
} catch (ex) {
Expand Down Expand Up @@ -484,6 +484,8 @@ var DefaultProperties = {
target.blocks = opts.blocks || [];
target.blocksLength = target.blocks.length;

target.root = (typeof global === "object" && global) ? global : window;

target.maxLength = 0;

target.backspace = false;
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"form",
"input"
],
"version": "0.6.14",
"version": "0.7.0",
"author": {
"name": "Max Huang",
"url": "http://github.com/nosir",
Expand Down
2 changes: 1 addition & 1 deletion src/Cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Cleave.prototype = {
// external google closure lib
try {
pps.phoneFormatter = new Cleave.PhoneFormatter(
new window.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
pps.delimiter
);
} catch (ex) {
Expand Down
2 changes: 1 addition & 1 deletion src/Cleave.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var Cleave = React.createClass({
// external google closure lib
try {
pps.phoneFormatter = new PhoneFormatter(
new Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode),
pps.delimiter
);
} catch (ex) {
Expand Down
2 changes: 2 additions & 0 deletions src/common/DefaultProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ var DefaultProperties = {
target.blocks = opts.blocks || [];
target.blocksLength = target.blocks.length;

target.root = (typeof global === "object" && global) ? global : window;

target.maxLength = 0;

target.backspace = false;
Expand Down

0 comments on commit 3963ad1

Please sign in to comment.