• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

glorious-codes / glorious-demo / 971b12eb-089e-42e4-89d6-04e2d7329d1c

pending completion
971b12eb-089e-42e4-89d6-04e2d7329d1c

Pull #107

circleci

GitHub
build(deps): bump minimist from 1.2.5 to 1.2.6
Pull Request #107: build(deps): bump minimist from 1.2.5 to 1.2.6

62 of 62 branches covered (100.0%)

Branch coverage included in aggregate %.

273 of 273 relevant lines covered (100.0%)

10.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/scripts/components/application/application.js
1
import '@styles/application.styl';
2
import domService from '../../services/dom/dom';
3
import textService from '../../services/text/text';
4
import template from './application.html';
5

6
export class Application {
7
  constructor(applicationType, options = {}){
9✔
8
    this.type = applicationType;
38✔
9
    this.options = options;
38✔
10
    this.element = buildElement(applicationType);
38✔
11
    this.setOptions(this.options);
38✔
12
  }
13
  setOptions(options){
14
    if(options.minHeight)
38✔
15
      this.setMinHeight(options.minHeight);
1✔
16
    if(options.windowTitle)
38✔
17
      this.setWindowTitle(options.windowTitle);
3✔
18
    this.configAnimation(options.inanimate);
38✔
19
  }
20
  setMinHeight(height){
21
    const applicationTopbarHeight = 26;
1✔
22
    const contentContainer = getContentContainerElement(this.element);
1✔
23
    const contentContainerMinHeight = parseInt(height) - applicationTopbarHeight;
1✔
24
    contentContainer.style.minHeight = `${contentContainerMinHeight}px`;
1✔
25
  }
26
  setWindowTitle(title){
27
    const titleContainerElement = getWindowTitleContainerElement(this.element);
29✔
28
    titleContainerElement.innerText = title;
29✔
29
    this.windowTitle = title;
29✔
30
  }
31
  configAnimation(inanimate){
32
    this.setInanimate(inanimate);
38✔
33
    if(inanimate)
38✔
34
      getBaseApplicationElement(this.element).classList.add('application-inanimate');
1✔
35
  }
36
  addContent(content){
37
    const container = getContentContainerElement(this.element);
3✔
38
    container.appendChild(content);
3✔
39
  }
40
  setInanimate(inanimate){
41
    this.inanimate = inanimate;
38✔
42
  }
43
  minimize(){
44
    this.setMaximized(false);
2✔
45
    handleResizingCssClass(this.element, 'remove', 'application-maximized');
2✔
46
    handleResizingCssClass(this.element, 'add', 'application-minimized');
2✔
47
  }
48
  maximize(){
49
    this.setMaximized(true);
2✔
50
    handleResizingCssClass(this.element, 'remove', 'application-minimized');
2✔
51
    handleResizingCssClass(this.element, 'add', 'application-maximized');
2✔
52
  }
53
  setMaximized(isMaximized){
54
    this.isMaximized = isMaximized;
4✔
55
  }
56
}
57

58
function buildElement(applicationType){
59
  let element = buildWrapper(applicationType);
38✔
60
  element.appendChild(domService.parseHtml(template));
38✔
61
  return element;
38✔
62
}
63

64
function buildWrapper(applicationType){
65
  const wrapper = document.createElement('div');
38✔
66
  const cssClass = `${textService.toKebabCase(applicationType)}-application`;
38✔
67
  wrapper.setAttribute('class', cssClass);
38✔
68
  return wrapper;
38✔
69
}
70

71
function getContentContainerElement(applicationElement){
72
  return applicationElement.querySelector('[data-content-container]');
4✔
73
}
74

75
function getWindowTitleContainerElement(applicationElement){
76
  return applicationElement.querySelector('[data-title-container]');
29✔
77
}
78

79
function handleResizingCssClass(element, classListMethod, cssClass){
80
  getBaseApplicationElement(element).classList[classListMethod](cssClass);
8✔
81
}
82

83
function getBaseApplicationElement(element){
84
  return element.querySelector('[data-application]');
9✔
85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc