diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp
index 43ee54ecd267129a4d8013ebb9ed66e7f73af60a..3ea39cf196b0da3d950956dbf5a0866a6dd78452 100644
--- a/indra/newview/llfloatersidepanelcontainer.cpp
+++ b/indra/newview/llfloatersidepanelcontainer.cpp
@@ -56,30 +56,11 @@ BOOL LLFloaterSidePanelContainer::postBuild()
 }
 
 void  LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm )
-{
-	/*
-	LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
-	if (panel_outfit_edit)
-	{
-		LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit);
-		if (parent == this )
-		{
-			LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance"));
-			panel_appearance->onClose(this);			
-		}
-		else
-		{
-			LLFloater::onClickCloseBtn();
-		}
-	}
-	else
-	{
-		LLFloater::onClickCloseBtn();
-	}
-	*/
+{	
 	onClickCloseBtn();
 }
 
+
 LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer()
 {
 	LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this);
@@ -92,20 +73,10 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key)
 
 void LLFloaterSidePanelContainer::onClickCloseBtn()
 {
-	LLPanelOutfitEdit* panel_outfit_edit =
-		dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
-	if (panel_outfit_edit)
+	LLSidepanelAppearance* panel = getSidePanelAppearance();
+	if ( panel )
 	{
-		LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit);
-		if (parent == this )
-		{
-			LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance"));
-			panel_appearance->onClose(this);			
-		}
-		else
-		{
-			LLFloater::onClickCloseBtn();
-		}
+		panel->onClose( this );			
 	}
 	else
 	{
@@ -114,7 +85,7 @@ void LLFloaterSidePanelContainer::onClickCloseBtn()
 }
 void LLFloaterSidePanelContainer::close()
 {
-		LLFloater::onClickCloseBtn();
+	LLFloater::onClickCloseBtn();
 }
 
 LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params)
@@ -124,7 +95,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na
 
 	if (!getVisible())
 	{
-	openFloater();
+		openFloater();
 	}
 
 	LLPanel* panel = NULL;
@@ -145,10 +116,30 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na
 
 void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key)
 {
-	LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name);
+	//If we're already open then check whether anything is dirty	 
+	LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name);	
 	if (floaterp)
 	{
-		floaterp->openChildPanel(sMainPanelName, key);
+		if ( floaterp->getVisible() )
+		{
+			LLSidepanelAppearance* panel = floaterp->getSidePanelAppearance();
+			if ( panel )
+			{
+				if ( panel->checkForDirtyEdits() )
+				{
+					panel->onClickConfirmExitWithoutSaveIntoAppearance();
+				}
+				else
+				{
+					//or a call into some new f() that just shows inv panel?
+					floaterp->openChildPanel(sMainPanelName, key);
+				}
+			}
+		}
+		else
+		{
+			floaterp->openChildPanel(sMainPanelName, key);
+		}
 	}
 }
 
@@ -172,3 +163,19 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name,
 
 	return NULL;
 }
+
+LLSidepanelAppearance* LLFloaterSidePanelContainer::getSidePanelAppearance()
+{
+	LLSidepanelAppearance* panel_appearance = NULL;
+	LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
+	if (panel_outfit_edit)
+	{
+		LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit);
+		if (parent == this )
+		{
+			panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance"));
+		}
+	}
+	return panel_appearance;			
+
+}
\ No newline at end of file
diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h
index 26fc092200cdee838e8cb64a5bd48234940cbac0..974934b48f02c14c4540e0b7c4f3ffa675148a2e 100644
--- a/indra/newview/llfloatersidepanelcontainer.h
+++ b/indra/newview/llfloatersidepanelcontainer.h
@@ -30,6 +30,8 @@
 
 #include "llfloater.h"
 
+class LLSidepanelAppearance;
+
 /**
  * Class LLFloaterSidePanelContainer
  *
@@ -81,6 +83,9 @@ class LLFloaterSidePanelContainer : public LLFloater
 		}
 		return panel;
 	}
+
+private:
+	LLSidepanelAppearance* getSidePanelAppearance();
 };
 
 #endif // LL_LLFLOATERSIDEPANELCONTAINER_H
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index f77275fd1c5111d07431f20c4c3a9067a489b53b..1b56aff3b6b4845e462b64fa15053ff7af7abdbd 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -114,14 +114,45 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose()
 	}
 }
 
+
+bool LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response)
+{
+	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+	if ( option == 0 ) 
+	{	
+		//revert current edits
+		mEditWearable->revertChanges();
+		toggleWearableEditPanel(FALSE);		
+		LLVOAvatarSelf::onCustomizeEnd( FALSE );	
+		//mLLFloaterSidePanelContainer->close();			
+		showOutfitsInventoryPanel();
+		return true;
+	}
+	return false;
+}
+
+void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance()
+{
+	if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() )
+	{
+		LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this;
+		LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance,pSelf,_1,_2) );
+	}
+	else
+	{
+		showOutfitsInventoryPanel();
+	}
+}
 void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack()
 {
-	if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened /*&& !LLAppearanceMgr::getInstance()->isOutfitLocked()*/ )
+	/*
+	if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() )
 	{
 		LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this;
 		LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) );
 	}
 	else
+		*/
 	{
 		showOutfitsInventoryPanel();
 	}
@@ -629,3 +660,8 @@ void LLSidepanelAppearance::updateScrollingPanelList()
 		mEditWearable->updateScrollingPanelList();
 	}
 }
+
+bool LLSidepanelAppearance::checkForDirtyEdits()
+{
+	return ( mEditWearable->isDirty() ) ? true : false;
+}
\ No newline at end of file
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index 85e7734567538a5f5992e903725824a4d96f9f9b..caf5be62e90c9826386aad2969dde537973f078c 100644
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -73,7 +73,9 @@ class LLSidepanelAppearance : public LLPanel
 	void onClickConfirmExitWithoutSaveViaBack();
 	bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response);
 	void onClickConfirmExitWithoutSaveViaClose();
-
+	bool checkForDirtyEdits();	
+	bool callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response);
+	void onClickConfirmExitWithoutSaveIntoAppearance();
 
 private:
 	void onFilterEdit(const std::string& search_string);