Skip to content

Instantly share code, notes, and snippets.

@chrisfinch
Last active December 10, 2015 23:38
Show Gist options
  • Save chrisfinch/4510370 to your computer and use it in GitHub Desktop.
Save chrisfinch/4510370 to your computer and use it in GitHub Desktop.

channel_filter.ejs:

<div class="header">
  <p>
    Click channels to <span>remove</span> from results
  </p>
  <p class="toggles">
    <a class="button off all_off">All Off</a>
    <a class="button on all_on disabled">All On</a>
  <p>
</div>
<div id='channel_buttons_container'>
  <? $.each(channel_list, function(id, channel) { ?>
    <a id='<?= channel ?>' class='channel_image_icon'>
    </a>
  <? }); ?>
</div>
<div id='buttons_container'>
  <a class="button apply">Apply</a>
  <a class="button cancel">Cancel</a>
</div>

search_filters.js

...

this.channel_filter = new EJS({url: "assets/modules/templates/channel_filter.ejs.js"}).render();

this.$channel_filter = this.$search_cont.find("#channel_filter").append(this.channel_filter);

...

Returned in the HTML:

function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('
\n
\n Click channels to remove from results\n
\n
\n All Off\n All On\n
\n
\n
\n '); $.each(channel_list, function(id, channel) { ; __p.push('\n \n \n '); }); ; __p.push('\n
\n
\n Apply\n Cancel\n
\n');}return __p.join('');}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment