Convert the find controller to ES6 syntax

Moreover, rename `FindStates` to `FindState` since enumeration names are
usually not in plural, for readability and consistency with the ones in
`src/shared/util.js`.
This commit is contained in:
Tim van der Meij 2017-06-04 20:35:21 +02:00
parent 8654635b0b
commit 9a95d91b92
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
2 changed files with 400 additions and 404 deletions

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { FindStates } from './pdf_find_controller';
import { FindState } from './pdf_find_controller';
import { NullL10n } from './ui_utils';
/**
@ -108,19 +108,19 @@ class PDFFindBar {
var status = '';
switch (state) {
case FindStates.FIND_FOUND:
case FindState.FOUND:
break;
case FindStates.FIND_PENDING:
case FindState.PENDING:
status = 'pending';
break;
case FindStates.FIND_NOTFOUND:
case FindState.NOT_FOUND:
findMsg = this.l10n.get('find_not_found', null, 'Phrase not found');
notFound = true;
break;
case FindStates.FIND_WRAPPED:
case FindState.WRAPPED:
if (previous) {
findMsg = this.l10n.get('find_reached_top', null,
'Reached top of document, continued from bottom');