Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Commit

Permalink
Merge pull request #497 from jmcarp/feature/excise-glossary
Browse files Browse the repository at this point in the history
Use glossary from fec-style.
  • Loading branch information
Noah Manger committed Aug 20, 2015
2 parents 7a6518e + 9d82342 commit 7dafcd1
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 207 deletions.
7 changes: 5 additions & 2 deletions static/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var _ = require('underscore');
var keyboard = require('keyboardjs');
var perfectScrollbar = require('perfect-scrollbar/jquery') ($);

var glossary = require('fec-style/js/glossary');

require('jquery.inputmask');
require('jquery.inputmask/dist/inputmask/jquery.inputmask.date.extensions.js');
require('jquery.inputmask/dist/inputmask/jquery.inputmask.numeric.extensions.js');
Expand All @@ -21,12 +23,10 @@ var accordion = require('./modules/accordion');
var filters = require('./modules/filters.js');
var typeahead = require('./modules/typeahead.js');
var charts = require('./modules/charts.js');
var glossary = require('./modules/glossary.js');
var Search = require('./modules/search');
var toggle = require('./modules/toggle');

typeahead.init();
glossary.init();
charts.init();

var SLT_ACCORDION = '.js-accordion';
Expand Down Expand Up @@ -57,6 +57,9 @@ $(document).ready(function() {
});
}

// Initialize glossary
new glossary.Glossary('#glossary', '#glossary-toggle');

// Inialize input masks
$('[data-inputmask]').inputmask();

Expand Down
119 changes: 0 additions & 119 deletions static/js/modules/glossary.js

This file was deleted.

78 changes: 0 additions & 78 deletions static/js/modules/terms.json

This file was deleted.

4 changes: 2 additions & 2 deletions static/js/modules/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ var URI = require('URIjs');
var Handlebars = require('handlebars');
var keyboard = require('keyboardjs');

var terms = require('fec-style/js/terms');

var events = require('./events.js');
var terms = require('./terms');
var glossary = require('./glossary.js');

var SUGGESTION_LIMIT = 10;

Expand Down
10 changes: 6 additions & 4 deletions templates/partials/glossary.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<div id="glossary" class="glossary"
aria-describedby="glossary-result" aria-hidden="true">
<button title="Close glossary" class="button button--close"
id="hide-glossary"><span class="u-visually-hidden">Hide glossary</span></button>
<button
title="Close glossary"
class="button button--close toggle"
><span class="u-visually-hidden">Hide glossary</span>
</button>
<h2>FEC Glossary</h2>
<label for="glossary-search" class="label">Filter glossary terms</label>
<input id="glossary-search" class="glossary__search" type="search" placeholder="e.g. Committee">
<div class="glossary__content" id="glossary-result">
<ul class="glossary__list js-accordion">
</ul>
<ul class="glossary__list js-accordion"></ul>
</div>
</div>
2 changes: 1 addition & 1 deletion tests/selenium/base_test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def getMain(self):

def getGlossary(self):
return self.driver.find_element_by_id('glossary')

def elementExistsByClassName(self, name):
try:
self.driver.find_element_by_class_name(name)
Expand Down
2 changes: 1 addition & 1 deletion tests/selenium/landing_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def testGlossaryToggle(self):
self.driver.find_element_by_id('glossary-toggle').click()
glossary = self.getGlossary()
self.assertIn('is-open', glossary.get_attribute('class'))
hide = glossary.find_element_by_id('hide-glossary')
hide = glossary.find_element_by_css_selector('.toggle')
WebDriverWait(self.driver, 1).until(lambda driver: hide.is_displayed())
hide.click()
self.assertNotIn('is-open', glossary.get_attribute('class'))
Expand Down

0 comments on commit 7dafcd1

Please sign in to comment.