Commit e9c3738c authored by Amir.h Yeganemehr's avatar Amir.h Yeganemehr

tslinting

parent 325b8563
......@@ -3,29 +3,29 @@
import * as $ from "jquery";
$.fn.bootstrapCheckbox = function(){
function setClasses(){
let $label = $(this).parents('label');
let checked:boolean = $(this).prop('checked');
if(checked){
if(!$label.hasClass('checked')){
$label.addClass('checked');
const $label = $(this).parents("label");
const checked: boolean = $(this).prop("checked");
if (checked){
if (!$label.hasClass("checked")){
$label.addClass("checked");
}
$label.removeClass('indeterminate');
$label.removeClass("indeterminate");
}else{
$label.removeClass('checked');
let indeterminate:boolean = $(this).prop('checked');
if(indeterminate){
$label.addClass('indeterminate');
$label.removeClass("checked");
const indeterminate: boolean = $(this).prop("checked");
if (indeterminate){
$label.addClass("indeterminate");
}
}
}
let $checkboxs = $(this);
const $checkboxs = $(this);
$checkboxs.each(setClasses);
$checkboxs.on('change', setClasses);
$checkboxs.on('focus', function(){
$(this).parents('label').addClass('focus');
$checkboxs.on("change", setClasses);
$checkboxs.on("focus", function(){
$(this).parents("label").addClass("focus");
});
$checkboxs.on('blur', function(){
$(this).parents('label').removeClass('focus');
$checkboxs.on("blur", function(){
$(this).parents("label").removeClass("focus");
});
}
\ No newline at end of file
};
......@@ -2,4 +2,4 @@
interface JQuery {
bootstrapCheckbox();
}
\ No newline at end of file
}
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"interface-name":[false],
"indent": [true, "tabs", 4],
"one-line": [true, "check-catch", "check-finally", "check-else"],
"no-reference": false
},
"rulesDirectory": []
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment