add showView method to open a url in the view tab

This commit is contained in:
Doug Bell 2010-08-18 16:18:56 -05:00
parent 393520688b
commit d61e1b1c5f

View file

@ -163,15 +163,7 @@ appendToUrl
*/
WebGUI.Admin.prototype.editAsset
= function ( url ) {
// Show the view tab
this.tabBar.selectTab( 0 );
this.currentTab = "view";
// Open the edit form
window.frames["view"].location.href = appendToUrl( url, "func=edit" );
// Mark undirty, as we'll clean it ourselves
this.viewDirty = 0;
this.showView( appendToUrl( url, "func=edit" ) );
};
/**
@ -191,6 +183,25 @@ WebGUI.Admin.prototype.gotoAsset
}
};
/**
* showView ( [url] )
* Open the view tab, optionally navigating to the given URL
*/
WebGUI.Admin.prototype.showView
= function (url) {
// Show the view tab
this.tabBar.selectTab( 0 );
this.currentTab = "view";
if ( url ) {
// Open the URL
window.frames["view"].location.href = url;
// Mark undirty, as we'll clean it ourselves
this.viewDirty = 0;
}
};
/**
* makeEditAsset( url )
* Create a callback to edit an asset. Use when attaching to event listeners