You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.3 KiB

  1. openerp.help_popup = function(instance, local) {
  2. var _t = instance.web._t;
  3. instance.web.ViewManager.include({
  4. do_create_view: function(view_type) {
  5. var self = this;
  6. var res = self._super(view_type);
  7. self.$el.find('span.view_help').each(function () {
  8. var $elem = $(this);
  9. if ($elem.data('click-init')) {
  10. return true;
  11. }
  12. $elem.data('click-init', true);
  13. //alert('ee' + self.action)
  14. console.log(self.action.id)
  15. if (self.action.id == undefined || (self.action.advanced_help == '' && self.action.enduser_help == '')) {
  16. self.$el.find('span.view_help').hide()
  17. }
  18. $elem.on('click', function(e) {
  19. var params = 'height=650, width=800, location=no, ';
  20. params += 'resizable=yes, menubar=yes';
  21. path = self.action.id;
  22. my_window = window.open('/report/html/help_popup.tpl_help/' + path, 'Help', params);
  23. // allows to back to the window if opened previoulsy
  24. setTimeout('my_window.focus()', 1);
  25. });
  26. return true;
  27. });
  28. return res;
  29. },
  30. });
  31. }