您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

freeze_page.js 1.6 KiB

14 年前
14 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
  2. //
  3. // MIT License (MIT)
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a
  6. // copy of this software and associated documentation files (the "Software"),
  7. // to deal in the Software without restriction, including without limitation
  8. // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. // and/or sell copies of the Software, and to permit persons to whom the
  10. // Software is furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  19. // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  20. // OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. //
  22. var fcount = 0;
  23. var frozen = 0;
  24. var dialog_message;
  25. var dialog_back;
  26. function freeze(msg, do_freeze) {
  27. // blur
  28. if(!dialog_back) {
  29. dialog_back = $a($i('body_div'), 'div', 'dialog_back');
  30. $(dialog_back).css('opacity', 0.6);
  31. }
  32. $ds(dialog_back);
  33. fcount++;
  34. frozen = 1;
  35. }
  36. function unfreeze() {
  37. if(dialog_message)
  38. $dh(dialog_message);
  39. if(!fcount)return; // anything open?
  40. fcount--;
  41. if(!fcount) {
  42. $dh(dialog_back);
  43. frozen = 0;
  44. }
  45. }