From 2bc30cc2b40686d2afde88285b920896f39441a9 Mon Sep 17 00:00:00 2001 From: Dries De Rudder Date: Thu, 12 Mar 2015 23:09:43 +0100 Subject: [PATCH 1/4] add option basePath --- src/ui-ace.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui-ace.js b/src/ui-ace.js index a664fb1..43f346e 100644 --- a/src/ui-ace.js +++ b/src/ui-ace.js @@ -30,6 +30,12 @@ angular.module('ui.ace', []) */ var setOptions = function(acee, session, opts) { + // sets the ace base path + if (angular.isDefined(opts.basePath)) { + var config = window.ace.require('ace/config'); + config.set('basePath', opts.basePath); + } + // sets the ace worker path, if running from concatenated // or minified source if (angular.isDefined(opts.workerPath)) { From 7e16912078056ef520c08dcafe8cb2411c2221d7 Mon Sep 17 00:00:00 2001 From: Dries De Rudder Date: Thu, 12 Mar 2015 23:35:50 +0100 Subject: [PATCH 2/4] fix jshint warning --- src/ui-ace.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui-ace.js b/src/ui-ace.js index 43f346e..df810eb 100644 --- a/src/ui-ace.js +++ b/src/ui-ace.js @@ -29,17 +29,16 @@ angular.module('ui.ace', []) * @param {object} opts Options to be set */ var setOptions = function(acee, session, opts) { + var config = window.ace.require('ace/config'); // sets the ace base path if (angular.isDefined(opts.basePath)) { - var config = window.ace.require('ace/config'); config.set('basePath', opts.basePath); } // sets the ace worker path, if running from concatenated // or minified source if (angular.isDefined(opts.workerPath)) { - var config = window.ace.require('ace/config'); config.set('workerPath', opts.workerPath); } // ace requires loading From 07b71ebe1fbf9c6b1bcb2ba175d589576ab64665 Mon Sep 17 00:00:00 2001 From: Dries De Rudder Date: Thu, 12 Mar 2015 23:43:51 +0100 Subject: [PATCH 3/4] fix jshint warning --- src/ui-ace.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui-ace.js b/src/ui-ace.js index df810eb..17f1fb4 100644 --- a/src/ui-ace.js +++ b/src/ui-ace.js @@ -29,16 +29,18 @@ angular.module('ui.ace', []) * @param {object} opts Options to be set */ var setOptions = function(acee, session, opts) { - var config = window.ace.require('ace/config'); + // sets the ace base path if (angular.isDefined(opts.basePath)) { - config.set('basePath', opts.basePath); + var basePathConfig = window.ace.require('ace/config'); + basePathConfig.set('basePath', opts.basePath); } // sets the ace worker path, if running from concatenated // or minified source if (angular.isDefined(opts.workerPath)) { + var config = window.ace.require('ace/config'); config.set('workerPath', opts.workerPath); } // ace requires loading From ccc283f65b4f79b641f6d4250e30ed464bde1e98 Mon Sep 17 00:00:00 2001 From: Dries De Rudder Date: Thu, 12 Mar 2015 23:46:05 +0100 Subject: [PATCH 4/4] cleanup fix --- src/ui-ace.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui-ace.js b/src/ui-ace.js index 17f1fb4..151fc2f 100644 --- a/src/ui-ace.js +++ b/src/ui-ace.js @@ -29,18 +29,17 @@ angular.module('ui.ace', []) * @param {object} opts Options to be set */ var setOptions = function(acee, session, opts) { - // sets the ace base path if (angular.isDefined(opts.basePath)) { - var basePathConfig = window.ace.require('ace/config'); + var basePathConfig = window.ace.require('ace/config'); basePathConfig.set('basePath', opts.basePath); } // sets the ace worker path, if running from concatenated // or minified source if (angular.isDefined(opts.workerPath)) { - var config = window.ace.require('ace/config'); + var config = window.ace.require('ace/config'); config.set('workerPath', opts.workerPath); } // ace requires loading