<div dir="ltr">Hi guys,<div><br></div><div>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</div>
<div><br></div><div>I tried many ways of dealing with that and I failed completly. The way I create the script is this:</div><div><br></div><div>scriptToOpenDialogOn: html value: value <br></div><div><br></div><div><div>((html jQuery: '#popupContainer') dialog close),</div>
<div><span class="" style="white-space:pre">                </span>((html jQuery: '#popupContainer') dialog</div><div><span class="" style="white-space:pre">                                        </span>title: value second;</div><div><span class="" style="white-space:pre">                                        </span>html: value first;</div>
<div><span class="" style="white-space:pre">                                        </span>modal: false;</div><div><span class="" style="white-space:pre">                                        </span>autoOpen: true;</div><div><span class="" style="white-space:pre">                                        </span>draggable: true;</div>
<div><span class="" style="white-space:pre">                                        </span>resizable: false;</div><div><span class="" style="white-space:pre">                                        </span>position: 'top';</div><div><span class="" style="white-space:pre">                                        </span>closeOnEscape: true;</div>
<div><span class="" style="white-space:pre">                                        </span>width: 900;</div><div><span class="" style="white-space:pre">                                        </span>addButton: 'Close' do: (html jQuery: '#popupContainer') dialog close)</div><div>
<span class="" style="white-space:pre">                                        </span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">And that is appended to #script: of an ajax callback:</span></div>
<div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">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))
                                                                </span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">Any ideas how could i make those 900 pixels to be a % of say..the width of the root document?</span></div>
<div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">Thanks in advance,</span></div><div><span class="" style="white-space:pre"><br></span></div><div><br></div>-- <br>Mariano<br>
<a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
</div></div>