add: if (previous) previous.syncModel(true); 
context: function init() {	if (!this.recorderInitialized) {		log.info("initializing");		this.recorderInitialized = true;		this.setOptions(optionsManager.load());		//this.options.load();		this.eventManager = new EventManager(this);		this.treeView = new TreeView(this, document, document.getElementById("commands"));		this.sourceView = new SourceView(this, document.getElementById("source"));		this.testCaseListeners = new Array();		this.setTestCase = function(testCase) {			this.testCase = testCase;			for (var i = 0; i < this.testCaseListeners.length; i++) {				this.testCaseListeners[i](this.testCase);			}		};		this.setTestCase(new TestCase());		this.testCaseListeners.push(function(testCase) { recorder.view.testCase = testCase });		this.toggleView = function(view) {			log.debug("toggle view");			if (this.view != null) {				this.view.onHide();			}			this.view = view;			this.view.testCase = this.testCase;			this.view.refresh();		};		initOptions();		this.toggleView(this.treeView);		var controller = {			supportsCommand : function(cmd) {				switch (cmd) {				case "cmd_close":				case "cmd_open":				case "cmd_save":				case "cmd_selenium_play":				case "cmd_selenium_pause":				case "cmd_selenium_step":					return true;				default:				return false;				}			},			isCommandEnabled : function(cmd){				switch (cmd) {				case "cmd_close":				case "cmd_open":				case "cmd_save":					return true;				case "cmd_selenium_play":				    return self.state != 'playing';				case "cmd_selenium_pause":				    return self.state == 'playing' || self.state == 'paused';				case "cmd_selenium_step":				    return self.state == 'paused';				default:				    return false;				}			},			doCommand : function(cmd) {				switch (cmd) {				case "cmd_close": if (confirmClose()) { window.close(); } break;				case "cmd_save": saveTestCase(); break;				case "cmd_open": loadTestCase(); break;				case "cmd_selenium_play": seleniumDebugger.start(); break;				case "cmd_selenium_pause": 				    if (self.state == 'paused') {						seleniumDebugger.doContinue();					} else {						seleniumDebugger.pause();					}				    break;				case "cmd_selenium_step":				    seleniumDebugger.doContinue(true);				    break;				default:				}			},			onEvent : function(evt) {}		};		window.controllers.appendController(controller);				document.commandDispatcher.updateCommands("selenium-ide-state");		log.info("initialized");		setTimeout("afterInit()", 500);	}}
meta: 3175	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3175/8559b7c3e1067cd32f5489bd7a35360a222901a0/selenium-ide.js/buggy/src/content/selenium-ide.js