Skip to content

Commit

Permalink
merge from ww: fixing how SCB versiondiffer is invoked
Browse files Browse the repository at this point in the history
  • Loading branch information
rksm committed May 21, 2012
1 parent 87e1df1 commit 5ad54c7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions core/lively/ide/BrowserCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ lively.ide.BrowserCommand.subclass('lively.ide.RunTestMethodCommand', {
},

});

lively.ide.BrowserCommand.subclass('lively.ide.OpenInFileEditorCommand', {

wantsMenu: Functions.True,
Expand All @@ -618,6 +619,7 @@ lively.ide.BrowserCommand.subclass('lively.ide.OpenInFileEditorCommand', {


});

lively.ide.BrowserCommand.subclass('lively.ide.OpenDiffViewerCommand', {

wantsMenu: Functions.True,
Expand All @@ -631,9 +633,16 @@ lively.ide.BrowserCommand.subclass('lively.ide.OpenDiffViewerCommand', {
return [['diff versions', this.diffVersions.bind(this)]]
},
diffVersions: function() {
var url = URL.codeBase.withFilename(this.browser.selectedNode().moduleName);
var differ = lively.PartsBin.getPart('VersionDiffer', 'PartsBin/NewWorld');
var pos = this.world().visibleBounds().center()
var moduleNode = this.browser.getPane1Selection(),
moduleName = moduleNode && moduleNode.moduleName;
if (!moduleNode || !moduleName) {
alert('No module selected');
return;
}
var m = module(moduleName),
url = m.uri(),
differ = lively.PartsBin.getPart('VersionDiffer', 'PartsBin/Tools'),
pos = this.world().visibleBounds().center()
differ.openInWorld();
differ.align(differ.bounds().center(), pos)
differ.targetMorph.setURL(url);
Expand Down

0 comments on commit 5ad54c7

Please sign in to comment.