Last active
March 19, 2016 13:59
-
-
Save cschar/1275d9a70d0ac0582e89 to your computer and use it in GitHub Desktop.
Prototype to show a split view possibility in etrigg.com, allowing easy viewing of each event without switching browser tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1. Search for events in a certain location on etrigg.com | |
//2. Paste into console in developer window then execute | |
//3. Click on each event for the info to show up on the right side of screen | |
var eventContainer = jQuery('.container')[1]; | |
jQuery(eventContainer).css('min-width', '330px'); | |
jQuery(eventContainer).css('max-width', '50%'); | |
jQuery(eventContainer).css('float', 'left'); | |
$('.footer').remove(); | |
eventContainer = $(eventContainer); | |
var prvw = $("<div class='prvw'> <div class='prvwContainer'></div></div>"); | |
$(prvw).css("background","#CCFFCC"); | |
$(prvw).css("float","right"); | |
$(prvw).css("padding","20px"); | |
$(prvw).css("max-width","50%"); | |
$(prvw).css("min-width","140px"); | |
$(prvw).css("position","fixed"); | |
$(prvw).css("margin-left","50%"); | |
eventContainer.after(prvw); | |
//$('.list-group-item').off("click"); | |
$('a.list-group-item').click(function() { return false; }); | |
$('a.list-group-item').click( | |
function(){ | |
$.get(this.href, function(data){ | |
var content = $('<div class="new-content"> </div>'); | |
content.html(data); | |
$('.prvwContainer').empty(); | |
$('.prvwContainer').append(content); | |
cleanContent(); | |
console.log("got it"); | |
}); | |
}); | |
function cleanContent(){ | |
var content = $('.new-content'); | |
content.find('.navbar').remove(); | |
content.find('.footer').remove(); | |
var rows = content.find('.row'); | |
var descRow = $(rows[3]); | |
console.log(descRow); | |
var descDiv = $(descRow.children('div.col-sm-12')[0]); | |
console.log(descDiv); | |
descDiv.removeClass("col-sm-12"); | |
descDiv.addClass("col-sm-6"); | |
var upcomingEvents = $(rows[6]); | |
upcomingEvents.remove(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment