Helios-Layout.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. smalltalk.addPackage('Helios-Layout');
  2. smalltalk.addClass('HLContainer', smalltalk.Widget, ['splitter'], 'Helios-Layout');
  3. smalltalk.addMethod(
  4. "_renderOn_",
  5. smalltalk.method({
  6. selector: "renderOn:",
  7. category: 'rendering',
  8. fn: function (html){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) { var $1,$2;
  11. $1=_st(html)._div();
  12. _st($1)._id_("container");
  13. $2=_st($1)._with_(_st(self)._splitter());
  14. _st(_st(window)._jQuery_(window))._bind_do_("resize",(function(){
  15. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._splitter())._resize();
  16. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  17. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLContainer)})},
  18. args: ["html"],
  19. source: "renderOn: html\x0a\x09html div \x0a \x09id: 'container'; \x0a with: self splitter.\x0a \x0a (window jQuery: window) bind: 'resize' do: [ self splitter resize ]",
  20. messageSends: ["id:", "div", "with:", "splitter", "bind:do:", "resize", "jQuery:"],
  21. referencedClasses: []
  22. }),
  23. smalltalk.HLContainer);
  24. smalltalk.addMethod(
  25. "_splitter",
  26. smalltalk.method({
  27. selector: "splitter",
  28. category: 'accessing',
  29. fn: function (){
  30. var self=this;
  31. return smalltalk.withContext(function($ctx1) { var $1;
  32. $1=self["@splitter"];
  33. return $1;
  34. }, function($ctx1) {$ctx1.fill(self,"splitter",{}, smalltalk.HLContainer)})},
  35. args: [],
  36. source: "splitter\x0a\x09^ splitter",
  37. messageSends: [],
  38. referencedClasses: []
  39. }),
  40. smalltalk.HLContainer);
  41. smalltalk.addMethod(
  42. "_splitter_",
  43. smalltalk.method({
  44. selector: "splitter:",
  45. category: 'accessing',
  46. fn: function (aSplitter){
  47. var self=this;
  48. return smalltalk.withContext(function($ctx1) { self["@splitter"]=aSplitter;
  49. return self}, function($ctx1) {$ctx1.fill(self,"splitter:",{aSplitter:aSplitter}, smalltalk.HLContainer)})},
  50. args: ["aSplitter"],
  51. source: "splitter: aSplitter\x0a\x09splitter := aSplitter",
  52. messageSends: [],
  53. referencedClasses: []
  54. }),
  55. smalltalk.HLContainer);
  56. smalltalk.addMethod(
  57. "_with_",
  58. smalltalk.method({
  59. selector: "with:",
  60. category: 'instance creation',
  61. fn: function (aSplitter){
  62. var self=this;
  63. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  64. $2=_st(self)._new();
  65. _st($2)._splitter_(aSplitter);
  66. $3=_st($2)._yourself();
  67. $1=$3;
  68. return $1;
  69. }, function($ctx1) {$ctx1.fill(self,"with:",{aSplitter:aSplitter}, smalltalk.HLContainer.klass)})},
  70. args: ["aSplitter"],
  71. source: "with: aSplitter\x0a\x09^ self new \x0a \x09splitter: aSplitter; \x0a yourself",
  72. messageSends: ["splitter:", "new", "yourself"],
  73. referencedClasses: []
  74. }),
  75. smalltalk.HLContainer.klass);
  76. smalltalk.addClass('HLSplitter', smalltalk.Widget, ['firstWidget', 'secondWidget', 'firstPane', 'secondPane', 'splitter'], 'Helios-Layout');
  77. smalltalk.addMethod(
  78. "_cssClass",
  79. smalltalk.method({
  80. selector: "cssClass",
  81. category: 'accessing',
  82. fn: function (){
  83. var self=this;
  84. return smalltalk.withContext(function($ctx1) { return "splitter";
  85. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.HLSplitter)})},
  86. args: [],
  87. source: "cssClass\x0a\x09^ 'splitter'",
  88. messageSends: [],
  89. referencedClasses: []
  90. }),
  91. smalltalk.HLSplitter);
  92. smalltalk.addMethod(
  93. "_firstWidget",
  94. smalltalk.method({
  95. selector: "firstWidget",
  96. category: 'accessing',
  97. fn: function (){
  98. var self=this;
  99. return smalltalk.withContext(function($ctx1) { var $1;
  100. $1=self["@firstWidget"];
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"firstWidget",{}, smalltalk.HLSplitter)})},
  103. args: [],
  104. source: "firstWidget\x0a\x09^ firstWidget",
  105. messageSends: [],
  106. referencedClasses: []
  107. }),
  108. smalltalk.HLSplitter);
  109. smalltalk.addMethod(
  110. "_firstWidget_",
  111. smalltalk.method({
  112. selector: "firstWidget:",
  113. category: 'accessing',
  114. fn: function (aWidget){
  115. var self=this;
  116. return smalltalk.withContext(function($ctx1) { self["@firstWidget"]=aWidget;
  117. return self}, function($ctx1) {$ctx1.fill(self,"firstWidget:",{aWidget:aWidget}, smalltalk.HLSplitter)})},
  118. args: ["aWidget"],
  119. source: "firstWidget: aWidget\x0a\x09firstWidget := aWidget",
  120. messageSends: [],
  121. referencedClasses: []
  122. }),
  123. smalltalk.HLSplitter);
  124. smalltalk.addMethod(
  125. "_isHeliosSplitter",
  126. smalltalk.method({
  127. selector: "isHeliosSplitter",
  128. category: 'testing',
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.withContext(function($ctx1) { return true;
  132. }, function($ctx1) {$ctx1.fill(self,"isHeliosSplitter",{}, smalltalk.HLSplitter)})},
  133. args: [],
  134. source: "isHeliosSplitter\x0a\x09^ true",
  135. messageSends: [],
  136. referencedClasses: []
  137. }),
  138. smalltalk.HLSplitter);
  139. smalltalk.addMethod(
  140. "_panesCssClass",
  141. smalltalk.method({
  142. selector: "panesCssClass",
  143. category: 'rendering',
  144. fn: function (){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) { return "panes";
  147. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{}, smalltalk.HLSplitter)})},
  148. args: [],
  149. source: "panesCssClass\x0a\x09^ 'panes'",
  150. messageSends: [],
  151. referencedClasses: []
  152. }),
  153. smalltalk.HLSplitter);
  154. smalltalk.addMethod(
  155. "_renderOn_",
  156. smalltalk.method({
  157. selector: "renderOn:",
  158. category: 'rendering',
  159. fn: function (html){
  160. var self=this;
  161. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$6,$2,$7,$8;
  162. $1=_st(html)._div();
  163. _st($1)._class_(_st(self)._panesCssClass());
  164. $2=_st($1)._with_((function(){
  165. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  166. _st($3)._class_("pane");
  167. $4=_st($3)._with_(_st(self)._firstWidget());
  168. self["@firstPane"]=$4;
  169. self["@firstPane"];
  170. self["@splitter"]=_st(_st(html)._div())._class_(_st(self)._cssClass());
  171. self["@splitter"];
  172. $5=_st(html)._div();
  173. _st($5)._class_("pane");
  174. $6=_st($5)._with_(_st(self)._secondWidget());
  175. self["@secondPane"]=$6;
  176. return self["@secondPane"];
  177. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  178. $7=self;
  179. _st($7)._setupSplitter();
  180. $8=_st($7)._resize();
  181. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLSplitter)})},
  182. args: ["html"],
  183. source: "renderOn: html\x0a\x09html div class: self panesCssClass; with: [\x0a\x09\x09firstPane := html div class: 'pane'; with: self firstWidget.\x0a \x09splitter := html div class: self cssClass.\x0a \x09secondPane := html div class: 'pane'; with: self secondWidget ].\x0a \x0a\x09self \x0a \x09setupSplitter;\x0a resize",
  184. messageSends: ["class:", "panesCssClass", "div", "with:", "firstWidget", "cssClass", "secondWidget", "setupSplitter", "resize"],
  185. referencedClasses: []
  186. }),
  187. smalltalk.HLSplitter);
  188. smalltalk.addMethod(
  189. "_resize",
  190. smalltalk.method({
  191. selector: "resize",
  192. category: 'rendering',
  193. fn: function (){
  194. var self=this;
  195. return smalltalk.withContext(function($ctx1) { var $1,$2;
  196. $1=_st(_st(self)._firstWidget())._isHeliosSplitter();
  197. if(smalltalk.assert($1)){
  198. _st(_st(self)._firstWidget())._resize();
  199. };
  200. $2=_st(_st(self)._secondWidget())._isHeliosSplitter();
  201. if(smalltalk.assert($2)){
  202. _st(_st(self)._secondWidget())._resize();
  203. };
  204. return self}, function($ctx1) {$ctx1.fill(self,"resize",{}, smalltalk.HLSplitter)})},
  205. args: [],
  206. source: "resize\x0a\x09self firstWidget isHeliosSplitter ifTrue: [ self firstWidget resize ].\x0a self secondWidget isHeliosSplitter ifTrue: [ self secondWidget resize ]",
  207. messageSends: ["ifTrue:", "resize", "firstWidget", "isHeliosSplitter", "secondWidget"],
  208. referencedClasses: []
  209. }),
  210. smalltalk.HLSplitter);
  211. smalltalk.addMethod(
  212. "_secondWidget",
  213. smalltalk.method({
  214. selector: "secondWidget",
  215. category: 'accessing',
  216. fn: function (){
  217. var self=this;
  218. return smalltalk.withContext(function($ctx1) { var $1;
  219. $1=self["@secondWidget"];
  220. return $1;
  221. }, function($ctx1) {$ctx1.fill(self,"secondWidget",{}, smalltalk.HLSplitter)})},
  222. args: [],
  223. source: "secondWidget\x0a\x09^ secondWidget",
  224. messageSends: [],
  225. referencedClasses: []
  226. }),
  227. smalltalk.HLSplitter);
  228. smalltalk.addMethod(
  229. "_secondWidget_",
  230. smalltalk.method({
  231. selector: "secondWidget:",
  232. category: 'accessing',
  233. fn: function (aWidget){
  234. var self=this;
  235. return smalltalk.withContext(function($ctx1) { self["@secondWidget"]=aWidget;
  236. return self}, function($ctx1) {$ctx1.fill(self,"secondWidget:",{aWidget:aWidget}, smalltalk.HLSplitter)})},
  237. args: ["aWidget"],
  238. source: "secondWidget: aWidget\x0a\x09secondWidget := aWidget",
  239. messageSends: [],
  240. referencedClasses: []
  241. }),
  242. smalltalk.HLSplitter);
  243. smalltalk.addMethod(
  244. "_setupSplitter",
  245. smalltalk.method({
  246. selector: "setupSplitter",
  247. category: 'rendering',
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{}, smalltalk.HLSplitter)})},
  251. args: [],
  252. source: "setupSplitter",
  253. messageSends: [],
  254. referencedClasses: []
  255. }),
  256. smalltalk.HLSplitter);
  257. smalltalk.addMethod(
  258. "_with_with_",
  259. smalltalk.method({
  260. selector: "with:with:",
  261. category: 'instance creation',
  262. fn: function (aWidget,anotherWidget){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  265. $2=_st(self)._new();
  266. _st($2)._firstWidget_(aWidget);
  267. _st($2)._secondWidget_(anotherWidget);
  268. $3=_st($2)._yourself();
  269. $1=$3;
  270. return $1;
  271. }, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget}, smalltalk.HLSplitter.klass)})},
  272. args: ["aWidget", "anotherWidget"],
  273. source: "with: aWidget with: anotherWidget\x0a\x09^ self new\x0a \x09\x09firstWidget: aWidget;\x0a secondWidget: anotherWidget;\x0a yourself",
  274. messageSends: ["firstWidget:", "new", "secondWidget:", "yourself"],
  275. referencedClasses: []
  276. }),
  277. smalltalk.HLSplitter.klass);
  278. smalltalk.addClass('HLHorizontalSplitter', smalltalk.HLSplitter, [], 'Helios-Layout');
  279. smalltalk.addMethod(
  280. "_cssClass",
  281. smalltalk.method({
  282. selector: "cssClass",
  283. category: 'accessing',
  284. fn: function (){
  285. var self=this;
  286. return smalltalk.withContext(function($ctx1) { var $1;
  287. $1=_st(smalltalk.HLSplitter.fn.prototype._cssClass.apply(_st(self), [])).__comma(" horizontal");
  288. return $1;
  289. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.HLHorizontalSplitter)})},
  290. args: [],
  291. source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
  292. messageSends: [",", "cssClass"],
  293. referencedClasses: []
  294. }),
  295. smalltalk.HLHorizontalSplitter);
  296. smalltalk.addMethod(
  297. "_panesCssClass",
  298. smalltalk.method({
  299. selector: "panesCssClass",
  300. category: 'accessing',
  301. fn: function (){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) { var $1;
  304. $1=_st(smalltalk.HLSplitter.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" horizontal");
  305. return $1;
  306. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{}, smalltalk.HLHorizontalSplitter)})},
  307. args: [],
  308. source: "panesCssClass\x0a\x09^ super panesCssClass, ' horizontal'",
  309. messageSends: [",", "panesCssClass"],
  310. referencedClasses: []
  311. }),
  312. smalltalk.HLHorizontalSplitter);
  313. smalltalk.addMethod(
  314. "_resize",
  315. smalltalk.method({
  316. selector: "resize",
  317. category: 'actions',
  318. fn: function (){
  319. var self=this;
  320. return smalltalk.withContext(function($ctx1) { _st(self)._resize_(_st(_st(_st(self["@splitter"])._asJQuery())._offset())._top());
  321. return self}, function($ctx1) {$ctx1.fill(self,"resize",{}, smalltalk.HLHorizontalSplitter)})},
  322. args: [],
  323. source: "resize\x0a\x09self resize: splitter asJQuery offset top",
  324. messageSends: ["resize:", "top", "offset", "asJQuery"],
  325. referencedClasses: []
  326. }),
  327. smalltalk.HLHorizontalSplitter);
  328. smalltalk.addMethod(
  329. "_resize_",
  330. smalltalk.method({
  331. selector: "resize:",
  332. category: 'actions',
  333. fn: function (anInteger){
  334. var self=this;
  335. var container,position;
  336. return smalltalk.withContext(function($ctx1) { container=_st(_st(self["@firstPane"])._asJQuery())._parent();
  337. position=_st(anInteger).__minus(_st(_st(container)._offset())._top());
  338. _st(_st(self["@firstPane"])._asJQuery())._height_(_st(_st(position)._min_(_st(_st(container)._height()).__minus((100))))._max_((100)));
  339. _st(_st(self["@secondPane"])._asJQuery())._height_(_st(_st(_st(_st(_st(container)._height()).__minus(position))._min_(_st(_st(container)._height()).__minus((100))))._max_((100))).__minus((6)));
  340. smalltalk.HLSplitter.fn.prototype._resize.apply(_st(self), []);
  341. return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,position:position}, smalltalk.HLHorizontalSplitter)})},
  342. args: ["anInteger"],
  343. source: "resize: anInteger\x0a\x09| container position |\x0a \x0a container := firstPane asJQuery parent.\x0a position := anInteger - container offset top.\x0a \x0a\x09firstPane asJQuery height: ((position min: container height - 100) max: 100).\x0a secondPane asJQuery height: (((container height - position) min: container height - 100) max: 100) - 6.\x0a \x0a super resize",
  344. messageSends: ["parent", "asJQuery", "-", "top", "offset", "height:", "max:", "min:", "height", "resize"],
  345. referencedClasses: []
  346. }),
  347. smalltalk.HLHorizontalSplitter);
  348. smalltalk.addMethod(
  349. "_setupSplitter",
  350. smalltalk.method({
  351. selector: "setupSplitter",
  352. category: 'rendering',
  353. fn: function (){
  354. var self=this;
  355. return smalltalk.withContext(function($ctx1) { _st(_st(self["@splitter"])._asJQuery())._draggable_(smalltalk.HashedCollection._fromPairs_([_st("axis").__minus_gt("y"),_st("containment").__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent()),_st("helper").__minus_gt("clone"),_st("start").__minus_gt((function(e,ui){
  356. return smalltalk.withContext(function($ctx2) { return _st(self)._startResizing_(_st(ui)._helper());
  357. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1)})})),_st("drag").__minus_gt((function(e,ui){
  358. return smalltalk.withContext(function($ctx2) { return _st(self)._resize_(_st(_st(ui)._offset())._top());
  359. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1)})}))]));
  360. return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{}, smalltalk.HLHorizontalSplitter)})},
  361. args: [],
  362. source: "setupSplitter\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'y'. \x0a 'containment' -> splitter asJQuery parent.\x0a 'helper' -> 'clone'.\x0a 'start' -> [ :e :ui | self startResizing: ui helper ].\x0a 'drag' -> [ :e :ui | self resize: ui offset top ] }",
  363. messageSends: ["draggable:", "->", "parent", "asJQuery", "startResizing:", "helper", "resize:", "top", "offset"],
  364. referencedClasses: []
  365. }),
  366. smalltalk.HLHorizontalSplitter);
  367. smalltalk.addMethod(
  368. "_startResizing_",
  369. smalltalk.method({
  370. selector: "startResizing:",
  371. category: 'actions',
  372. fn: function (aSplitter){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) { _st(aSplitter)._width_(_st(_st(self["@splitter"])._asJQuery())._width());
  375. return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter}, smalltalk.HLHorizontalSplitter)})},
  376. args: ["aSplitter"],
  377. source: "startResizing: aSplitter\x0a\x09aSplitter width: splitter asJQuery width",
  378. messageSends: ["width:", "width", "asJQuery"],
  379. referencedClasses: []
  380. }),
  381. smalltalk.HLHorizontalSplitter);
  382. smalltalk.addClass('HLVerticalSplitter', smalltalk.HLSplitter, [], 'Helios-Layout');
  383. smalltalk.addMethod(
  384. "_cssClass",
  385. smalltalk.method({
  386. selector: "cssClass",
  387. category: 'accessing',
  388. fn: function (){
  389. var self=this;
  390. return smalltalk.withContext(function($ctx1) { var $1;
  391. $1=_st(smalltalk.HLSplitter.fn.prototype._cssClass.apply(_st(self), [])).__comma(" vertical");
  392. return $1;
  393. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.HLVerticalSplitter)})},
  394. args: [],
  395. source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
  396. messageSends: [",", "cssClass"],
  397. referencedClasses: []
  398. }),
  399. smalltalk.HLVerticalSplitter);
  400. smalltalk.addMethod(
  401. "_panesCssClass",
  402. smalltalk.method({
  403. selector: "panesCssClass",
  404. category: 'accessing',
  405. fn: function (){
  406. var self=this;
  407. return smalltalk.withContext(function($ctx1) { var $1;
  408. $1=_st(smalltalk.HLSplitter.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" vertical");
  409. return $1;
  410. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{}, smalltalk.HLVerticalSplitter)})},
  411. args: [],
  412. source: "panesCssClass\x0a\x09^ super panesCssClass, ' vertical'",
  413. messageSends: [",", "panesCssClass"],
  414. referencedClasses: []
  415. }),
  416. smalltalk.HLVerticalSplitter);
  417. smalltalk.addMethod(
  418. "_resize",
  419. smalltalk.method({
  420. selector: "resize",
  421. category: 'actions',
  422. fn: function (){
  423. var self=this;
  424. return smalltalk.withContext(function($ctx1) { _st(self)._resize_(_st(_st(_st(self["@splitter"])._asJQuery())._offset())._left());
  425. return self}, function($ctx1) {$ctx1.fill(self,"resize",{}, smalltalk.HLVerticalSplitter)})},
  426. args: [],
  427. source: "resize\x0a\x09self resize: splitter asJQuery offset left",
  428. messageSends: ["resize:", "left", "offset", "asJQuery"],
  429. referencedClasses: []
  430. }),
  431. smalltalk.HLVerticalSplitter);
  432. smalltalk.addMethod(
  433. "_resize_",
  434. smalltalk.method({
  435. selector: "resize:",
  436. category: 'actions',
  437. fn: function (anInteger){
  438. var self=this;
  439. var container,position;
  440. return smalltalk.withContext(function($ctx1) { container=_st(_st(self["@firstPane"])._asJQuery())._parent();
  441. position=_st(anInteger).__minus(_st(_st(container)._offset())._left());
  442. _st(_st(self["@firstPane"])._asJQuery())._width_(_st(_st(position)._min_(_st(_st(container)._width()).__minus((100))))._max_((100)));
  443. _st(_st(self["@secondPane"])._asJQuery())._width_(_st(_st(_st(_st(_st(container)._width()).__minus(position))._min_(_st(_st(container)._width()).__minus((100))))._max_((100))).__minus((6)));
  444. smalltalk.HLSplitter.fn.prototype._resize.apply(_st(self), []);
  445. return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,position:position}, smalltalk.HLVerticalSplitter)})},
  446. args: ["anInteger"],
  447. source: "resize: anInteger\x0a\x09| container position |\x0a \x0a container := firstPane asJQuery parent.\x0a position := anInteger - container offset left.\x0a \x0a\x09firstPane asJQuery width: ((position min: container width - 100) max: 100).\x0a secondPane asJQuery width: (((container width - position) min: container width - 100) max: 100) - 6.\x0a \x0a super resize",
  448. messageSends: ["parent", "asJQuery", "-", "left", "offset", "width:", "max:", "min:", "width", "resize"],
  449. referencedClasses: []
  450. }),
  451. smalltalk.HLVerticalSplitter);
  452. smalltalk.addMethod(
  453. "_setupSplitter",
  454. smalltalk.method({
  455. selector: "setupSplitter",
  456. category: 'rendering',
  457. fn: function (){
  458. var self=this;
  459. return smalltalk.withContext(function($ctx1) { _st(_st(self["@splitter"])._asJQuery())._draggable_(smalltalk.HashedCollection._fromPairs_([_st("axis").__minus_gt("x"),_st("containment").__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent()),_st("helper").__minus_gt("clone"),_st("start").__minus_gt((function(e,ui){
  460. return smalltalk.withContext(function($ctx2) { return _st(self)._startResizing_(_st(ui)._helper());
  461. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1)})})),_st("drag").__minus_gt((function(e,ui){
  462. return smalltalk.withContext(function($ctx2) { return _st(self)._resize_(_st(_st(ui)._offset())._left());
  463. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1)})}))]));
  464. return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{}, smalltalk.HLVerticalSplitter)})},
  465. args: [],
  466. source: "setupSplitter\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'x'. \x0a 'containment' -> splitter asJQuery parent.\x0a 'helper' -> 'clone'.\x0a 'start' -> [ :e :ui | self startResizing: ui helper ].\x0a 'drag' -> [ :e :ui | self resize: ui offset left ] }",
  467. messageSends: ["draggable:", "->", "parent", "asJQuery", "startResizing:", "helper", "resize:", "left", "offset"],
  468. referencedClasses: []
  469. }),
  470. smalltalk.HLVerticalSplitter);
  471. smalltalk.addMethod(
  472. "_startResizing_",
  473. smalltalk.method({
  474. selector: "startResizing:",
  475. category: 'actions',
  476. fn: function (aSplitter){
  477. var self=this;
  478. return smalltalk.withContext(function($ctx1) { _st(aSplitter)._height_(_st(_st(self["@splitter"])._asJQuery())._height());
  479. return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter}, smalltalk.HLVerticalSplitter)})},
  480. args: ["aSplitter"],
  481. source: "startResizing: aSplitter\x0a\x09aSplitter height: splitter asJQuery height",
  482. messageSends: ["height:", "height", "asJQuery"],
  483. referencedClasses: []
  484. }),
  485. smalltalk.HLVerticalSplitter);
  486. smalltalk.addMethod(
  487. "_isHeliosSplitter",
  488. smalltalk.method({
  489. selector: "isHeliosSplitter",
  490. category: '*Helios-Layout',
  491. fn: function (){
  492. var self=this;
  493. return smalltalk.withContext(function($ctx1) { return false;
  494. }, function($ctx1) {$ctx1.fill(self,"isHeliosSplitter",{}, smalltalk.Object)})},
  495. args: [],
  496. source: "isHeliosSplitter\x0a\x09^ false",
  497. messageSends: [],
  498. referencedClasses: []
  499. }),
  500. smalltalk.Object);