Exemplo n.º 1
0
 private void OnPaneContentsChanging(bool hasPages)
 {
     RemoveThumbnailListeners();
     // This check avoids a javascript error where "'stopListeningForSave' is not a function."
     if (hasPages)
     {
         // We get confusing Javascript errors if the websocket made for the previous version of this page
         // is still listening after the browser has navigated away to a new version of the page.
         // This used to be part of RemoveThumbnailListeners(), but that function is used elsewhere such that
         // we lost the Saving... toast functionality.
         _browser.RunJavaScript("if (typeof FrameExports !== 'undefined') {FrameExports.stopListeningForSave();}");
     }
 }
Exemplo n.º 2
0
 private void RemoveThumbnailListeners()
 {
     _browser.RemoveMessageEventListener("gridClick");
     _browser.RemoveMessageEventListener("gridReordered");
     _browser.RemoveMessageEventListener("menuClicked");
     // We get confusing Javascript errors if the websocket made for the previous version of this page
     // is still listening after the browser has navigated away to a new version of the page.
     _browser.RunJavaScript("if (typeof FrameExports !== 'undefined') {FrameExports.stopListeningForSave();}");
 }