41 lines
988 B
JavaScript
Vendored
41 lines
988 B
JavaScript
Vendored
import {dataTable} from "./utils/datatable";
|
||
import {block, blockElement, unblock, unblockElement} from "./utils/blockui";
|
||
import {init as initSelect2} from './utils/select2';
|
||
|
||
$('.logout-btn').on('click', e => {
|
||
e.preventDefault()
|
||
$('#logout-form').submit()
|
||
})
|
||
|
||
/**
|
||
* 第三方工具
|
||
*/
|
||
app.utils = {
|
||
dataTable: dataTable,
|
||
blockui: {
|
||
blockElement: blockElement,
|
||
unblockElement: unblockElement,
|
||
block: block,
|
||
unblock: unblock
|
||
},
|
||
select2: initSelect2,
|
||
}
|
||
|
||
app.methods = {
|
||
/**
|
||
* 檢查是否符合給定的Media Query
|
||
* 預設為max-width
|
||
* */
|
||
matchMedia: function(value, directive = 'max-width') {
|
||
return window.matchMedia('(' + directive + ': ' + value + ')').matches;
|
||
},
|
||
|
||
/**
|
||
* 檢查是否符合給定的Media Query,單位為px
|
||
* 預設為max-width
|
||
* */
|
||
matchMediaInPx(value, directive = 'max-width') {
|
||
return this.matchMedia(value + 'px', directive);
|
||
},
|
||
}
|