x.view.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $(function()
  2. {
  3. $('.main-actions-holder').css('height', '0px');
  4. var xuanAction = "<div class='xuancard-actions fixed'>";
  5. $('.main-col div.main-actions .btn-toolbar a').each(function(){
  6. var $that = $(this);
  7. if($that.attr('id') == 'back') return true;
  8. var href = $that.attr('href');
  9. var title = $that.attr('title') == undefined ? '' : " title='" + $that.attr('title') + "'";
  10. var btnClass = " class='" + $that.attr('class') + "'";
  11. var action = $that.html();
  12. if(href.indexOf('browse') >= 0 || href.indexOf('batchCreate') >= 0
  13. || href.indexOf('create') >= 0 || href.indexOf('delete') >= 0) return true;
  14. if($that.hasClass('iframe'))
  15. {
  16. url = href;
  17. target = '';
  18. }
  19. else
  20. {
  21. url = 'xxc:openUrlInDialog/' + encodeURIComponent(sysurl + href);
  22. target = " target='_blank'";
  23. }
  24. xuanAction += "<a href='" + url + "'" + title + target + btnClass + '>' + action + "</a>";
  25. });
  26. if(xuanAction != "<div class='xuancard-actions fixed'>")
  27. {
  28. var params = window.location.search;
  29. if(params.indexOf('isNotice=1') == -1)
  30. {
  31. xuanAction += '</div>';
  32. $('body').append(xuanAction);
  33. }
  34. }
  35. else
  36. {
  37. $('#scrollContent').css('height', 'calc(100% - 36px)');
  38. }
  39. $('.xuancard-actions a.iframe').modalTrigger();
  40. })