Function
Static Public Summary | ||
public |
Add some css styles to the top most position in head tag. |
|
public |
addToWindow(keyValue: string, element: Object): Promise<Object, MyError> Attach object to window without overwriting anything else. |
|
public |
Get window width's info in bootstrap 4's grid system standards. |
|
public |
Get jQuery from window. |
|
public |
Get scroll bar's width. |
|
public |
Check if the current page has scroll bar. |
|
public |
Add scroll to top anchor on the right bottom of the whole page. |
|
public |
init() Fix bootstrap modal's shifting issue. Run bse.fixModalShifting.init(); |
|
public |
init() Automatically toggle bootstrap collapse's chevron based on show or hide collapse. Add bse-toggleCollapChevron attribute to chevron link and run bse.toggleCollapseChevron.init(); |
|
public |
Convert a ul li menu to a select options element and display it on small device Add bse-resList attribute to ul and run bse.resList.init(); |
|
public |
Add a message when the table in .table-responsive is scrollable. |
|
public |
Check which grid level is window in. |
|
public |
prependClass(sel: Object, strClass: string) Add class names to the left most position to avoid overwriting original class's style |
|
public |
update(displayMessage: *) |
|
public |
update() |
|
public |
update() |
|
public |
update() |
|
public |
update() |
Static Public
public addStyles(css: string) source
import addStyles from 'bootstrap-enhancement/src/utilities/addStyles.js'
Add some css styles to the top most position in head tag.
Params:
Name | Type | Attribute | Description |
css | string | Css styles that you want to add. |
Example:
bse.utilities.addStyles('.test{color: red}');
public addToWindow(keyValue: string, element: Object): Promise<Object, MyError> source
import addToWindow from 'bootstrap-enhancement/src/utilities/addToWindow.js'
Attach object to window without overwriting anything else.
Example:
bse.utilities.addToWindow('bse', bse);
public checkSize(): string source
import checkSize from 'bootstrap-enhancement/src/utilities/checkBreakPoint/checkSize.js'
Get window width's info in bootstrap 4's grid system standards.
Example:
const bsGrid = bse.utilities.checkBreakPoint.checkSize();
public getJquery(): Promise<Object, MyError> source
import getJquery from 'bootstrap-enhancement/src/utilities/getJquery.js'
Get jQuery from window. Must use this way to get jQuery if we want to attach something to bootstrap's event.
Example:
bse.utilities.getJquery().then(($)=>{console.log($)});
public getScrollBarWidth(): number source
import getScrollBarWidth from 'bootstrap-enhancement/src/utilities/getScrollBarWidth.js'
Get scroll bar's width.
Return:
number | Page's scroll bar width even if there is no scroll bar. Return 0 if scroll bar is transparent(Eg: Safari on iPhone/iPad). |
Example:
const scrollBarWidth = bse.utilities.getScrollBarWidth();
public hasScrollBar(): boolean source
import hasScrollBar from 'bootstrap-enhancement/src/utilities/hasScrollBar.js'
Check if the current page has scroll bar.
Return:
boolean | True if current page has scroll bar. False if doesn't have scroll bar or scroll bar is transparent(Eg: Safari on iPhone/iPad). |
Example:
const hasScrollBar = bse.utilities.hasScrollBar();
public init(innerElement: string) source
import {init} from 'bootstrap-enhancement/src/scrollToTop/index.js'
Add scroll to top anchor on the right bottom of the whole page.
Params:
Name | Type | Attribute | Description |
innerElement | string | Dom element string that you want to add to that anchor. |
Example:
bse.scrollToTop.init(`<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-chevron-up fa-stack-1x fa-inverse"></i>
</span>`);
public init() source
import {init} from 'bootstrap-enhancement/src/fixModalShifting/index.js'
Fix bootstrap modal's shifting issue. Run bse.fixModalShifting.init();
Example:
bse.fixModalShifting.init();
public init() source
import {init} from 'bootstrap-enhancement/src/toggleCollapseChevron/index.js'
Automatically toggle bootstrap collapse's chevron based on show or hide collapse. Add bse-toggleCollapChevron attribute to chevron link and run bse.toggleCollapseChevron.init();
Example:
<a data-toggle="collapse" href="#test">
<i class="fas fa-chevron-down" bse-toggleCollapChevron></i>
</a>
bse.toggleCollapseChevron.init();
public init(config: Object) source
import {init} from 'bootstrap-enhancement/src/resList/index.js'
Convert a ul li menu to a select options element and display it on small device Add bse-resList attribute to ul and run bse.resList.init();
Example:
<ul bse-resList>
<li><a class="h7" href="PASSENGER">PASSENGER</a></li>
<li><a class="h7" href="TRUCK">TRUCK</a></li>
<li><a class="h7" href="EARTHMOVER">EARTHMOVER</a></li>
<li><a class="h7" href="AGRICULTURE">AGRICULTURE</a></li>
<li><a class="h7" href="AVIATION">AVIATION</a></li>
<li><a class="h7" href="2R">2R</a></li>
</ul>
bse.resList.init();
public init(displayMessage: string) source
import {init} from 'bootstrap-enhancement/src/addScrollMessToResTable/index.js'
Add a message when the table in .table-responsive is scrollable. Add bse-resTableMess attribute to div.table-responsive and run bse.addScrollMessToResTable.init();
Params:
Name | Type | Attribute | Description |
displayMessage | string | Message that you want to display, default value is: Scroll table horizontally to see more. |
Example:
<div class="table-responsive" bse-resTableMess>
<table class="table">
<thead>
</thead>
<tbody>
</tbody>
</table>
</div>
bse.addScrollMessToResTable.init();
public is(str: *): boolean source
import is from 'bootstrap-enhancement/src/utilities/checkBreakPoint/is.js'
Check which grid level is window in.
Params:
Name | Type | Attribute | Description |
str | * |
Example:
const is = bse.utilities.checkBreakPoint.is('md');
public prependClass(sel: Object, strClass: string) source
import prependClass from 'bootstrap-enhancement/src/utilities/prependClass.js'
Add class names to the left most position to avoid overwriting original class's style
Example:
bse.utilities.prependClass(domElement, 'test-class');
public update(displayMessage: *) source
import {update} from 'bootstrap-enhancement/src/addScrollMessToResTable/index.js'
Params:
Name | Type | Attribute | Description |
displayMessage | * |
public update() source
import {update} from 'bootstrap-enhancement/src/toggleCollapseChevron/index.js'