f081d7236f
Adds an editable label allowing the change owner to edit patchset descriptions within the UI. Also re-styles the dropdowns pertaining to patchsets for better UX. Feature: Issue 4544 Change-Id: I15c0f8ab6a60c3a06482fe152539615d31eeae0f
45 lines
1.4 KiB
HTML
45 lines
1.4 KiB
HTML
<!--
|
|
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.
|
|
-->
|
|
<script>
|
|
(function(window) {
|
|
'use strict';
|
|
|
|
/** @polymerBehavior Gerrit.PatchSetBehavior */
|
|
var PatchSetBehavior = {
|
|
/**
|
|
* Given an object of revisions, get a particular revision based on patch
|
|
* num.
|
|
*
|
|
* @param {Object} revisions The object of revisions given by the API
|
|
* @param {number|string} patchNum The number index of the revision
|
|
* @return {Object} The correspondent revision obj from {revisions}
|
|
*/
|
|
getRevisionByPatchNum: function(revisions, patchNum) {
|
|
patchNum = parseInt(patchNum, 10);
|
|
for (var rev in revisions) {
|
|
if (revisions.hasOwnProperty(rev) &&
|
|
revisions[rev]._number === patchNum) {
|
|
return revisions[rev];
|
|
}
|
|
}
|
|
},
|
|
};
|
|
|
|
window.Gerrit = window.Gerrit || {};
|
|
window.Gerrit.PatchSetBehavior = PatchSetBehavior;
|
|
})(window);
|
|
</script>
|