[Seaside] How to built a JQDialog with a width that comes from a variable?

Mariano Martinez Peck marianopeck at gmail.com
Tue Jul 15 22:08:41 UTC 2014

Hi guys,

I am currently creating a JQDialog. Such an object allows one to define a
'width'. But it can only be passed a number (pixels). In my case I want a
special default..say $(window).width() * 0.9

I tried many ways of dealing with that and I failed completly. The way I
create the script is this:

scriptToOpenDialogOn: html value: value

((html jQuery: '#popupContainer') dialog close),
((html jQuery: '#popupContainer') dialog
title: value second;
html: value first;
modal: false;
autoOpen: true;
draggable: true;
resizable: false;
position: 'top';
closeOnEscape: true;
width: 900;
addButton: 'Close' do: (html jQuery: '#popupContainer') dialog close)

And that is appended to #script: of an ajax callback:

scriptForPopupClickHandlerOn: html | val | val := ValueHolder new. ^ html
jQuery this on: 'click' selector: '.clickablePopup' do: ((html jQuery ajax
callback: [:pass | val contents: pass first ] passengers: (html jQuery
this); script: [ :s | s << (self scriptToOpenDialogOn: s value: val
contents) ]) asFunction: #(event))

Any ideas how could i make those 900 pixels to be a % of say..the width of
the root document?

Thanks in advance,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20140715/6736e3a3/attachment.htm

More information about the seaside mailing list