title: Jquery UI Dialog conditional button text
body: <p>What's the correct way to have a UI Dialog "close" button display different text based on a condition? </p>
  
  <p>This was my wild guess which isn't working. </p>
  
  <pre><code>$("#settings_popup").dialog({
      buttons: [{
          text: (function() {
              if ("ui-id-1" == curTab) {
                  "Save"
              } else {
                  "Done"
              }
          }),
          click: function() {
              $(this).dialog("close");
          }
      }],
      close: onSettingsClose
  });
  </code></pre>