neuronetio / gantt-elastic

Gantt Chart [ javascript gantt chart, gantt component, vue gantt, vue gantt chart, responsive gantt, project manager , vue projects ]
https://neuronet.io/gantt-elastic/
MIT License
1.3k stars 315 forks source link

Bug with user's font size. #76

Closed demershov closed 5 years ago

demershov commented 5 years ago

There is the bug with processing the user's font size (dynamicStyle). On line 286 in GanttElastic.vue, fontSize property was got from userOptions.

function prepareStyle(userStyle) {
 let fontSize = '12px';
  let fontFamily = window
    .getComputedStyle(document.body)
    .getPropertyValue('font-family')
    .toString();
  if (typeof userStyle !== 'undefined') {
    if (typeof userStyle.fontSize !== 'undefined') {
      fontSize = userOptions.fontSize;
    }
    if (typeof userStyle.fontFamily !== 'undefined') {
      fontFamily = userStyle.fontFamily;
    }
  }
  return getStyle(fontSize, fontFamily);
}
fontSize = userOptions.fontSize;

The correct behavior is't to get fontSize property from userStyle object.

fontSize = userStyle.fontSize;
neuronetio commented 5 years ago

aww, ok, thanks

neuronetio commented 5 years ago

thanks :)

neuronetio commented 5 years ago

1.0.10