[FIX] pms: fix pre-commit warning on JS files (#23)

This commit is contained in:
Miguel Padin
2020-12-14 21:17:59 +01:00
committed by GitHub
parent 6ab51a004f
commit 3cf2d2bf33
3 changed files with 13 additions and 13 deletions

View File

@@ -11,15 +11,14 @@ odoo.define("pms.AbstractWebClient", function (require) {
var current_pms_property_id = var current_pms_property_id =
session.user_pms_properties.current_pms_property[0]; session.user_pms_properties.current_pms_property[0];
if (!state.pms_pids) { if (!state.pms_pids) {
state.pms_pids = state.pms_pids = utils.get_cookie("pms_pids")
utils.get_cookie("pms_pids") !== null ? utils.get_cookie("pms_pids")
? utils.get_cookie("pms_pids") : String(current_pms_property_id);
: String(current_pms_property_id);
} }
var statePmsPropertyIDS = _.map(state.pms_pids.split(","), function ( var statePmsPropertyIDS = _.map(state.pms_pids.split(","), function (
pms_pid pms_pid
) { ) {
return parseInt(pms_pid); return parseInt(pms_pid, 10);
}); });
var userPmsPropertyIDS = _.map( var userPmsPropertyIDS = _.map(
session.user_pms_properties.allowed_pms_properties, session.user_pms_properties.allowed_pms_properties,

View File

@@ -13,7 +13,8 @@ odoo.define("pms.ListController", function (require) {
ListController.include({ ListController.include({
renderButtons: function () { renderButtons: function () {
this._super.apply(this, arguments); // Sets this.$buttons // Sets this.$buttons
this._super.apply(this, arguments);
var self = this; var self = this;
if (this.modelName === "pms.reservation") { if (this.modelName === "pms.reservation") {
this.$buttons.append( this.$buttons.append(

View File

@@ -50,7 +50,7 @@ odoo.define("web.SwitchPmsMenu", function (require) {
) )
.split(",") .split(",")
.map(function (id) { .map(function (id) {
return parseInt(id); return parseInt(id, 10);
}); });
this.user_pms_properties = this.user_pms_properties =
session.user_pms_properties.allowed_pms_properties; session.user_pms_properties.allowed_pms_properties;
@@ -74,9 +74,9 @@ odoo.define("web.SwitchPmsMenu", function (require) {
*/ */
_onSwitchPmsPropertyClick: function (ev) { _onSwitchPmsPropertyClick: function (ev) {
if ( if (
ev.type == "keydown" && ev.type === "keydown" &&
ev.which != $.ui.keyCode.ENTER && ev.which !== $.ui.keyCode.ENTER &&
ev.which != $.ui.keyCode.SPACE ev.which !== $.ui.keyCode.SPACE
) { ) {
return; return;
} }
@@ -124,9 +124,9 @@ odoo.define("web.SwitchPmsMenu", function (require) {
*/ */
_onTogglePmsPropertyClick: function (ev) { _onTogglePmsPropertyClick: function (ev) {
if ( if (
ev.type == "keydown" && ev.type === "keydown" &&
ev.which != $.ui.keyCode.ENTER && ev.which !== $.ui.keyCode.ENTER &&
ev.which != $.ui.keyCode.SPACE ev.which !== $.ui.keyCode.SPACE
) { ) {
return; return;
} }