Repository: zeppelin Updated Branches: refs/heads/branch-0.7 6a6fcc2ed -> 7382c1c62
[ZEPPELIN-2577] No graphs visible on IE11 This PR fixes issue described in https://issues.apache.org/jira/browse/ZEPPELIN-2577 by adding .endsWith method. Bug Fix https://issues.apache.org/jira/browse/ZEPPELIN-2577 Build this PR and make sure built-in visualization is displayed in ie11 * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Lee moon soo <[email protected]> Closes #2384 from Leemoonsoo/ZEPPELIN-2577 and squashes the following commits: 40c6370 [Lee moon soo] update style 1b3129c [Lee moon soo] polyfill .endswith (cherry picked from commit beb6027f27cd5194b85f13d98c54e9acac4229b7) Signed-off-by: Lee moon soo <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7382c1c6 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7382c1c6 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7382c1c6 Branch: refs/heads/branch-0.7 Commit: 7382c1c62f8a4caff11d663f32f5346cbca0b037 Parents: 6a6fcc2 Author: Lee moon soo <[email protected]> Authored: Thu Jun 1 14:00:04 2017 -0700 Committer: Lee moon soo <[email protected]> Committed: Sat Jun 3 10:32:31 2017 -0700 ---------------------------------------------------------------------- zeppelin-web/src/app/app.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7382c1c6/zeppelin-web/src/app/app.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js index 40b19c1..19f2f57 100644 --- a/zeppelin-web/src/app/app.js +++ b/zeppelin-web/src/app/app.js @@ -168,6 +168,22 @@ function bootstrapApplication() { angular.bootstrap(document, ['zeppelinWebApp']); } -angular.element(document).ready(function() { - auth().then(bootstrapApplication); -}); +angular.element(document).ready(function () { + auth().then(bootstrapApplication) +}) + +// See ZEPPELIN-2577. No graphs visible on IE 11 +// Polyfill. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith +if (!String.prototype.endsWith) { + // eslint-disable-next-line no-extend-native + String.prototype.endsWith = function(searchString, position) { + let subjectString = this.toString() + if (typeof position !== 'number' || !isFinite(position) || + Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length + } + position -= searchString.length + let lastIndex = subjectString.indexOf(searchString, position) + return lastIndex !== -1 && lastIndex === position + } +}
