google-code-export / lwrte

Automatically exported from code.google.com/p/lwrte
1 stars 0 forks source link

Can't use panels when using select. #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce:
1. Create a custom toolbar with a control_1;
2. Set "select" and "exec" fields;
3. The exec function shall create_panel;
4. The created panel can't be dragged properly.

Panels shall be draggables, but they aren't when creating a custom exec 
function for a select field.

For example, I did this example:
var my_toolbar = {
  test_cmd: {select: '\
    <select>\
      <option value="">- Values -</option>\
      <option value="V1">Values A</option>\
      <option value="V2">Values B</option>\
    </select>',
    exec: function(sel) {
      var dialog = this.create_panel("Title", "250px");
      dialog.append("<p>Selected: " + sel.value + "</p>").show();
    }}};
/// ... init the LWRTE to use that toolbar ...

Performing a selection calls the function, the panel is correctly shown, but it 
is not draggable.

I'm trying to do some debugging, and so far I've got that the location 
variables (left, top) in the create_panel, starts as undefined and degenerates 
to NaN. In detail, logging the values:

.mousemove( 
  function(e) {
    if(drag && event) {
      $.loog("Dragging " + left);
      // ... normal code here

Outputs:
Dragging undefined
Dragging NaN
Dragging NaN
(continues with NaN).

I'm using the lastest version from the repository (not compressed version),  
that is 1.2, revision r50.

I'll continue investigate the problem as I'm needing these dialogs, but I'm not 
used with JavaScript nor I know jQuery and lwrte, so it may take some time.
If you could provide me some hints on why this is happening, maybe I'll solve 
it quickly and give a patch.

Original issue reported on code.google.com by akirossp...@gmail.com on 16 Jun 2010 at 8:49