bookmark.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. var Bookmark = {
  2. // Special XHR that sends in some code to be run
  3. // when the full bookmark form gets loaded
  4. BookmarkXHR: function(form)
  5. {
  6. SN.U.FormXHR(form, Bookmark.InitBookmarkForm);
  7. return false;
  8. },
  9. // Special initialization function just for the
  10. // second step in the bookmarking workflow
  11. InitBookmarkForm: function() {
  12. SN.Init.CheckBoxes();
  13. $('fieldset fieldset label').inFieldLabels({ fadeOpacity:0 });
  14. SN.Init.NoticeFormSetup($('#form_new_bookmark'));
  15. }
  16. }
  17. $(document).ready(function() {
  18. // Stop normal live event stuff
  19. $(document).off("submit", "form.ajax");
  20. $(document).off("click", "form.ajax input[type=submit]");
  21. // Make the bookmark submit super special
  22. $(document).on('submit', '#form_initial_bookmark', function (e) {
  23. Bookmark.BookmarkXHR($(this));
  24. e.stopPropagation();
  25. return false;
  26. });
  27. // Restore live event stuff to other forms & submit buttons
  28. SN.Init.AjaxForms();
  29. });