")
- .html(html)
- .appendTo($entry);
+ // Explicitly set heights for transitions
+ var height = $entry.outerHeight()
+ $entry
+ .attr('data-height', height)
+ .css('height', height)
- $entry.height(height + $readme.outerHeight());
+ // Get the data
+ $.ajax({
+ url: '-/readme/'
+ + encodeURIComponent($entry.attr('data-name')) + '/'
+ + encodeURIComponent($entry.attr('data-version')),
+ dataType: 'text',
+ success: function(html) {
+ var $readme = $("
")
+ .html(html)
+ .appendTo($entry)
- transitionComplete(function() {
- $entry.css('height', 'auto');
- });
- }
- });
- }
- });
-});
+ $entry.height(height + $readme.outerHeight())
+
+ transitionComplete(function() {
+ $entry.css('height', 'auto')
+ })
+ }
+ })
+ }
+ })
+})
},{"onclick":13,"transition-complete":15,"unopinionate":16}],4:[function(require,module,exports){
// twitter bootstrap stuff;
@@ -395,93 +397,92 @@ require('./bootstrap-modal')
require('./search')
require('./entry')
+var $ = require('unopinionate').selector
$(document).on('click', '.js-userLogoutBtn', function() {
- $('#userLogoutForm').submit()
- return false
+ $('#userLogoutForm').submit()
+ return false
})
-},{"./bootstrap-modal":2,"./entry":3,"./search":5}],5:[function(require,module,exports){
-var $ = require('unopinionate').selector,
- template = require('../entry.hbs'),
- onScroll = require('onscroll');
+},{"./bootstrap-modal":2,"./entry":3,"./search":5,"unopinionate":16}],5:[function(require,module,exports){
+var $ = require('unopinionate').selector
+var template = require('../entry.hbs')
+var onScroll = require('onscroll')
$(function() {
- 'use strict';
+ ;(function(window, document) {
+ var $form = $('#search-form')
+ var $input = $form.find('input')
+ var $body = $('body')
+ var $clear = $form.find('.clear')
+ var $searchResults = $('#search-results')
+ var $pkgListing = $('#all-packages')
+ var $searchBtn = $('.js-search-btn')
+ var request
+ var currentResults
- (function( window, document ) {
+ var toggle = function(validQuery) {
+ $searchResults.toggleClass('show', validQuery)
+ $pkgListing.toggleClass('hide', validQuery)
- var $form = $('#search-form');
- var $input = $form.find('input');
- var $body = $('body');
- var $clear = $form.find('.clear');
- var $searchResults = $("#search-results");
- var $pkgListing = $("#all-packages");
- var $searchBtn = $('.js-search-btn');
- var request;
- var currentResults;
+ $searchBtn.find('i').toggleClass('icon-cancel', validQuery)
+ $searchBtn.find('i').toggleClass('icon-search', !validQuery)
+ }
- var toggle = function( validQuery ) {
- $searchResults.toggleClass( 'show', validQuery );
- $pkgListing.toggleClass( 'hide', validQuery );
+ $form.bind('submit keyup', function(e) {
+ var q, qBool
+ e.preventDefault()
- $searchBtn.find('i').toggleClass( 'icon-cancel', validQuery );
- $searchBtn.find('i').toggleClass( 'icon-search', !validQuery );
- };
+ q = $input.val()
+ qBool = (q !== '')
- $form.bind('submit keyup', function(e) {
- var q, qBool;
+ toggle(qBool)
- e.preventDefault();
+ if (!qBool) {
+ if (request && typeof request.abort === 'function') {
+ request.abort()
+ }
- q = $input.val();
- qBool = q !== '';
+ currentResults = null
+ $searchResults.html('')
+ return
+ }
- toggle( qBool );
+ if (request && typeof request.abort === 'function') {
+ request.abort()
+ }
- if( !qBool ) {
- if( request && typeof request.abort === 'function' ) {
- request.abort();
- }
+ if (!currentResults) {
+ $searchResults.html(
+ "

")
+ }
- currentResults = null;
- $searchResults.html('');
- return;
- }
+ request = $.getJSON('-/search/' + q, function( results ) {
+ currentResults = results
- if( request && typeof request.abort === 'function' ) {
- request.abort();
- }
+ if (results.length > 0) {
+ var html = ''
- if( !currentResults ) {
- $searchResults.html( "

" );
- }
+ $.each(results, function(i, entry) {
+ html += template(entry)
+ })
- request = $.getJSON('-/search/' + q, function( results ) {
- currentResults = results;
+ $searchResults.html(html)
+ } else {
+ $searchResults.html(
+ "
No Results
")
+ }
+ })
+ })
- if( results.length > 0 ) {
- var html = '';
+ $(document).on('click', '.icon-cancel', function(e) {
+ e.preventDefault()
+ $input.val('')
+ $form.keyup()
+ })
- $.each(results, function( i, entry ) {
- html += template( entry );
- });
-
- $searchResults.html(html);
- } else {
- $searchResults.html("
No Results
");
- }
- });
- });
-
- $( document ).on( 'click', '.icon-cancel', function( e ) {
- e.preventDefault();
- $input.val('');
- $form.keyup();
- });
-
- })( window, window.document );
-});
+ })(window, window.document)
+})
},{"../entry.hbs":1,"onscroll":14,"unopinionate":16}],6:[function(require,module,exports){
"use strict";