Changeset 7807


Ignore:
Timestamp:
May 18, 2020, 2:38:32 PM (19 months ago)
Author:
Nicklas Nordborg
Message:

Fixes #2210: Double click in "Add parent item colum" should add the column

Location:
branches/3.16-stable/www
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.16-stable/www/common/columns/add_parent_column.js

    r7780 r7807  
    6464    Events.addEventHandler('subtype', 'change', configure.subtypeOnChange);
    6565    Events.addEventHandler('showAllAnnotationTypes', 'change', configure.updateColumnsList);
     66    Events.addEventHandler('column', 'dblclick', configure.addColumn);
     67    Events.addEventHandler(document.body, 'click', configure.hideMessage);
    6668   
    6769    // Buttons
     
    164166 
    165167 
    166   configure.addColumn = function()
     168  configure.addColumn = function(event)
    167169  {
    168170    var frm = document.forms['parents'];
     
    204206      return;
    205207    }
    206     else
    207     {
    208       for (var i = frm.column.length-1; i >= 0; i--)
    209       {
    210         if (frm.column[i].selected) frm.column[i] = null;
    211       }
    212     }
     208   
     209    for (var i = frm.column.length-1; i >= 0; i--)
     210    {
     211      if (frm.column[i].selected) frm.column[i] = null;
     212    }
     213    Doc.element('added-column-msg').innerHTML = numSelected == 1 ?
     214      '1 column has been added to the table.' : numSelected + ' columns have been added to the table.';
     215    Doc.show('added-column-msg');
     216    event.stopPropagation(); // To prevent the hideMessage() method from executing
     217  }
     218 
     219  configure.hideMessage = function(event)
     220  {
     221    Doc.hide('added-column-msg');
    213222  }
    214223 
  • branches/3.16-stable/www/common/columns/add_parent_column.jsp

    r7773 r7807  
    8080      <th>Column</th>
    8181      <td>
    82         <select name="column" id="column" style="min-width: 25em; height: calc(100% - 3em);" multiple>
    83         </select>
     82        <select name="column" id="column" style="min-width: 25em; height: calc(100% - 4em);" multiple></select>
     83        <div id="added-column-msg" class="messagecontainer note" style="display:none; margin: 0.5em 0;"></div>
    8484      </td>
    8585    </tr>
  • branches/3.16-stable/www/include/scripts/main-2.js

    r7769 r7807  
    22862286      element.addEventListener('blur', internal.hideNotification, false);
    22872287      element.addEventListener('keypress', internal.hideNotification, false);
     2288      element.addEventListener('click', internal.hideNotification, false);
    22882289      notifyDiv.addEventListener('click', internal.hideNotification, false);
    22892290    }
Note: See TracChangeset for help on using the changeset viewer.