diff --git a/main.js b/main.js index 20d35dc..8c39437 100644 --- a/main.js +++ b/main.js @@ -262,6 +262,17 @@ define(function (require, exports, module) { } } + var isSVG; + if (FileUtils.getFileExtension) { // Sprint 32+ + isSVG = function (fullPath) { + return FileUtils.getFileExtension(fullPath).toLowerCase() === "svg"; + }; + } else { // Sprint 31 & earlier + isSVG = function (fullPath) { + return FileUtils.getFilenameExtension(fullPath).toLowerCase() === ".svg"; + }; + } + /** */ function handleCurrentEditorChange() { @@ -269,8 +280,7 @@ define(function (require, exports, module) { var newEditor = EditorManager.getCurrentFullEditor(); if (newEditor) { - var ext = FileUtils.getFilenameExtension(newEditor.document.file.fullPath); - if (ext.toLowerCase() === ".svg") { + if (isSVG(newEditor.document.file.fullPath)) { showSVGPanel(newEditor); } else { hideSVGPanel(); diff --git a/package.json b/package.json index c53f2c3..d757867 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "SVG Preview", "homepage": "https://github.com/peterflynn/svg-preview", "author": "Peter Flynn", - "version": "1.1.1", + "version": "1.1.2", "engines": { "brackets": ">=0.14" }, "description": "Live preview SVG files in an inline panel while you edit them." } \ No newline at end of file