Changeset 1075 for trunk/modules/Dialogs


Ignore:
Timestamp:
10/09/08 22:02:30 (11 years ago)
Author:
nicholasbs
Message:

UPDATES #1283 (new-dialogs version of TableOperations? is incomplete)
ids/names are now properly added to the dialog reverse lookup table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/Dialogs/XinhaDialog.js

    r1058 r1075  
    10381038    function(fullString, id) 
    10391039    { 
    1040       if(typeof dialog.id[id] == 'undefined') 
    1041       { 
    1042         dialog.id[id] = Xinha.uniq('Dialog'); 
    1043         dialog.r_id[dialog.id[id]] = id; 
    1044       } 
    1045       return dialog.id[id]; 
     1040      return dialog.createId(id); 
    10461041    } 
    10471042    ).replace(/<l10n>(.*?)<\/l10n>/ig, 
     
    10581053  return html; 
    10591054} 
     1055 
     1056/** Use this function when adding an element with a new ID/name to a  
     1057 *  dialog after it has already been created. This function ensures 
     1058 *  that the dialog has the id/name stored in its reverse-lookup table 
     1059 *  (which is required for form values to be properly returned by 
     1060 *  Xinha.Dialog.hide). 
     1061 *  
     1062 * @param {id} the id (or name) to add  
     1063 * 
     1064 * Returns the internal ID to which the passed in ID maps 
     1065 * 
     1066 * TODO: createId is a really awful name, but I can't think of anything better... 
     1067 */ 
     1068Xinha.Dialog.prototype.createId = function(id) 
     1069{ 
     1070  var dialog = this; 
     1071  if (typeof dialog.id[id] == 'undefined') 
     1072  { 
     1073    dialog.id[id] = Xinha.uniq('Dialog'); 
     1074    dialog.r_id[dialog.id[id]] = id; 
     1075  } 
     1076  return dialog.id[id]; 
     1077}; 
    10601078 
    10611079/** When several modeless dialogs are shown, one can be brought to front with this function (as happens on mouseclick)  
Note: See TracChangeset for help on using the changeset viewer.