@@ -86,9 +86,7 @@ define(function main(require, exports, module) {
8686
8787 // update the config with the new state
8888 config . imageGalleryState = state ;
89- if ( MultiBrowserLiveDev && MultiBrowserLiveDev . status >= MultiBrowserLiveDev . STATUS_ACTIVE ) {
90- MultiBrowserLiveDev . updateConfig ( JSON . stringify ( config ) ) ;
91- }
89+ refreshConfigInLivePreview ( ) ;
9290 }
9391
9492 let params = new UrlParams ( ) ;
@@ -222,13 +220,6 @@ define(function main(require, exports, module) {
222220 } ) ;
223221 }
224222
225- /** force reload the live preview currently only with shortcut ctrl-shift-R */
226- function _handleReloadLivePreviewCommand ( ) {
227- if ( MultiBrowserLiveDev . status >= MultiBrowserLiveDev . STATUS_ACTIVE ) {
228- MultiBrowserLiveDev . reload ( ) ;
229- }
230- }
231-
232223 /**
233224 * Internal api used to update live edit capability status as entitlements changes. calling this will update the UI
234225 * but will not functionally enable live editing capabilities as that are dependent on entitlements framework.
@@ -315,7 +306,10 @@ define(function main(require, exports, module) {
315306 return ;
316307 }
317308 config . mode = currentMode ;
309+ refreshConfigInLivePreview ( ) ;
310+ }
318311
312+ function refreshConfigInLivePreview ( ) {
319313 if ( MultiBrowserLiveDev && MultiBrowserLiveDev . status >= MultiBrowserLiveDev . STATUS_ACTIVE ) {
320314 MultiBrowserLiveDev . updateConfig ( JSON . stringify ( config ) ) ;
321315 }
@@ -326,22 +320,15 @@ define(function main(require, exports, module) {
326320 function updateElementHighlightConfig ( ) {
327321 const prefValue = PreferencesManager . get ( "livePreviewElementHighlights" ) ;
328322 config . elemHighlights = prefValue || "hover" ;
329- if ( MultiBrowserLiveDev && MultiBrowserLiveDev . status >= MultiBrowserLiveDev . STATUS_ACTIVE ) {
330- MultiBrowserLiveDev . updateConfig ( JSON . stringify ( config ) ) ;
331- }
323+ refreshConfigInLivePreview ( ) ;
332324 }
333325
334326 function updateRulerLinesConfig ( ) {
335327 const prefValue = PreferencesManager . get ( "livePreviewShowRulerLines" ) ;
336328 config . showRulerLines = prefValue || false ;
337- if ( MultiBrowserLiveDev && MultiBrowserLiveDev . status >= MultiBrowserLiveDev . STATUS_ACTIVE ) {
338- MultiBrowserLiveDev . updateConfig ( JSON . stringify ( config ) ) ;
339- }
329+ refreshConfigInLivePreview ( ) ;
340330 }
341331
342- // init commands
343- CommandManager . register ( Strings . CMD_RELOAD_LIVE_PREVIEW , Commands . CMD_RELOAD_LIVE_PREVIEW , _handleReloadLivePreviewCommand ) ;
344-
345332 EventDispatcher . makeEventDispatcher ( exports ) ;
346333
347334 // private api
0 commit comments