x.view.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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('createCase') >= 0 || href.indexOf('toStory') >= 0 || href.indexOf('toTask') >= 0 || href.indexOf('create') >= 0 || href.indexOf('delete') >= 0) return true;
  13. if($that.hasClass('iframe'))
  14. {
  15. url = href;
  16. target = '';
  17. }
  18. else
  19. {
  20. url = 'xxc:openUrlInDialog/' + encodeURIComponent(sysurl + href);
  21. target = " target='_blank'";
  22. }
  23. xuanAction += "<a href='" + url + "'" + title + target + btnClass + '>' + action + "</a>";
  24. });
  25. if(xuanAction != "<div class='xuancard-actions fixed'>")
  26. {
  27. xuanAction += '</div>';
  28. $('body').append(xuanAction);
  29. }
  30. else
  31. {
  32. $('#scrollContent').css('height', 'calc(100% - 36px)');
  33. }
  34. $('.xuancard-actions a.iframe').modalTrigger();
  35. })