Friday, July 13, 2018

IE and Conditional Styles, eXist indexing...

So two challenges this week:


  1. I had created an angular javascript addition to the catalog to display the gift book information of a title, so you can click on it, and then get a listing of all gift books from that donor. Well I have this in place for most of the year, and just happened to notice in IE, that it was not working, and it was placing the words "Gift of" on each title since the stylesheet declaration to not display was not working.

    For the longest time, I thought it was strictly a CSS issue and IE, but the more I looked into it I saw that my conditional CSS was not getting populated with anything, and just was style="$ctrl.show".

    So I started looking for information on CSS, angular ctrl elements, and IE. And sure enough, found that you must use ng-style instead of style, otherwise, some browsers like IE will remove invalid style attribute values (presence of {} etc makes it invalid) before even angular has a chance to render it. When you use ng-style angular will calculate the expression and add the inline style attributes to it.

    However, even just flipping to just ng-style, was not enough, I needed to make it ng-attr-style <span ng-attr-style="$ctrl.show"> and now it works properly in both browsers. I also rewrote what I had as a module which is better than just a component.
  2. The other challenge has been eXist, and I could not figure out how I was not able to get any results in my eXist queries to just search for full text, and I know that there must have been something different that I was doing as it had worked before.

    Below is an example:

    http://exist.willamette.edu:8080/exist/apps/METSALTO/api/SearchQuery.xquery?q=all^Editorial^phrase&collection=studentpubs&type=search

    and this returns a json string of matches, but for some reason, it would work any other collection but the one I had been working on in studentpubs. I think it came down to who I was logged in when I ran the full-text indexing query. Ran as administrator I would never get results, re-ran as myself and I get results just fine now.
I'm just glad I did not have to ponder these issues over the weekend.

No comments:

Post a Comment