Skip to content

Commit

Permalink
JS: update Readmore, change call syntax
Browse files Browse the repository at this point in the history
Update Readmore to v3.0.0-beta-1 (latest release). v3 is no longer a jQuery plugin, so the GBL item module needs to call the feature via: new Readmore(...). Add simple js spec to test Readmore is defined.

Fixes #800
  • Loading branch information
ewlarson committed Jul 29, 2019
1 parent 796d53e commit 4258d45
Show file tree
Hide file tree
Showing 5 changed files with 624 additions and 15 deletions.
4 changes: 1 addition & 3 deletions app/assets/javascripts/geoblacklight/modules/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ Blacklight.onLoad(function() {
viewer = new window['GeoBlacklight']['Viewer'][viewerName](element);
});

$('.truncate-abstract').readmore({
maxHeight: 60
});
new Readmore( '.truncate-abstract', { maxHeight: 60 } );
});
2 changes: 1 addition & 1 deletion lib/generators/geoblacklight/templates/geoblacklight.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
//= require geoblacklight/downloaders
//= require leaflet-iiif
//= require esri-leaflet
//= require readmore.min
//= require readmore
4 changes: 4 additions & 0 deletions spec/javascripts/geoblacklight_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ describe('GeoBlacklight', function() {
it('MetadataDownloadButton is defined', function() {
expect(GeoBlacklight.MetadataDownloadButton).toBeDefined();
});

it ('Readmore is defined', function() {
expect(Readmore).toBeDefined();
});
});
});

0 comments on commit 4258d45

Please sign in to comment.