Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. reconnectOn: aSession
  2.     "find a right element and a context (at start we have only their ids)"
  3.     "deal specially with page unload event"
  4.     | object app |
  5.     object := aSession site urlResolver ooRefFromURL: self relativeUrl.
  6.     app := aSession webAppFor: object.
  7.     app isNil ifTrue: [^self].
  8.     self context: (self context notNil
  9.         ifTrue: [app contexts at: self context]
  10.         ifFalse: [app contextForView: self pageView]). "for unload event"
  11.     self context isNil ifTrue: [^self].
  12.     self context event: self.
  13.     #unload = self event ifTrue:
  14.         [app contexts
  15.             detect: [:ctx | ctx window id = self element
  16.                 ifTrue: [self element: ctx window. ^self] ifFalse: [false] ]
  17.             ifNone: [self element: nil. ^self] ].
  18.     (  #( #load #newtab) includes: self event) "page events"
  19.         ifTrue: [self element: self context page]Cascading not expected ->;  "element is entire page"
  20.         ifFalse: [self element: (self context elementId: self element)].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement