
The release of eslint 4 introduced some breaking changes -- a full upgrade guide can be found here [1]. In this change, the "no-useless-escape" and "indent" rules are disabled, "indent" being replaced with "indent-legacy" to minimize breaks due to lint. Also, extra spaces before comments and other assorted new lint issues are corrected. The long-term plan is to move away from the deprecated "indent-legacy" rule and also reenable the "no-useless-escape" rule, but for now we want to minimize breakages and not affect PG developer velocity. [1] http://eslint.org/docs/user-guide/migrating-to-4.0.0 Change-Id: I8044256c95e3fe3f94fa9acc7922600908f8a0f4
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
// Copyright (C) 2016 The Android Open Source Project
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
(function() {
|
|
'use strict';
|
|
|
|
Polymer({
|
|
is: 'gr-change-star',
|
|
|
|
properties: {
|
|
change: {
|
|
type: Object,
|
|
notify: true,
|
|
},
|
|
|
|
_xhrPromise: Object, // Used for testing.
|
|
},
|
|
|
|
_computeStarClass(starred) {
|
|
const classes = ['starButton'];
|
|
if (starred) {
|
|
classes.push('starButton-active');
|
|
}
|
|
return classes.join(' ');
|
|
},
|
|
|
|
toggleStar() {
|
|
const newVal = !this.change.starred;
|
|
this.set('change.starred', newVal);
|
|
this._xhrPromise = this.$.restAPI.saveChangeStarred(this.change._number,
|
|
newVal);
|
|
},
|
|
});
|
|
})();
|