[Nitro] Just a small thingy...

Emmanuel Piperakis epiperak at softlab.ece.ntua.gr
Thu Oct 13 05:16:19 EDT 2005


Bug fix...
In order for popup windows to be resizable and have scrollbars you have to 
add this line in
mixin/xhtml.rb
just after this line
poptions = (o[:resizable] ? 'resizable=yes' : 'resizable=no')

====ADD====
     poptions << ", "
===========
it adds a comma , in order to seperate the 2 fields

===================================================
the whole function....

def js_popup(options = {})
     o = {
       :width => 320,
       :height => 240,
       :title => 'Popup',
       :resizable => false,
       :scrollbars => false,
     }.merge(options)

     poptions = (o[:resizable] ? 'resizable=yes' : 'resizable=no')
     poptions << ", "
     poptions << (o[:scrollbars] ? 'scrollbars=yes' : 'scrollbars=no')

     url = o[:url] || o[:uri]

     %[javascript: var pwl = (screen.width - #{o[:width]}) / 2; var pwt = 
(screen.height - #{o[:height]}) / 2; window.open('#{url}', '#{o[:title]}', 
'width=#{o[:width]},height=#{o[:height]},top='+pwt+',left='+pwl+', 
#{poptions}'); return false;"]
   end
A

Emmanouil Piperakis (epiperak at cs.ntua.gr)
{To explore is Human, to Create is Devine,
  To teach is Primal, to Rule is Sin}



More information about the Nitro-general mailing list