aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js33
-rw-r--r--web/cobrands/sass/_base.scss62
-rw-r--r--web/cobrands/sass/_fixedthead.scss4
-rw-r--r--web/js/jquery.fixedthead.js81
4 files changed, 0 insertions, 180 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 1c1a654b9..4c159e5c3 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -601,13 +601,6 @@ $.extend(fixmystreet.set_up, {
}
},
- fixed_thead: function() {
- var thead = $('.nicetable thead');
- if (thead.fixedThead) {
- thead.fixedThead();
- }
- },
-
report_list_filters: function() {
// Hide the pin filter submit button. Not needed because we'll use JS
// to refresh the map when the filter inputs are changed.
@@ -620,12 +613,6 @@ $.extend(fixmystreet.set_up, {
mobile_ui_tweaks: function() {
//move 'skip this step' link on mobile
$('.mobile #skip-this-step').addClass('chevron').wrap('<li>').parent().appendTo('#key-tools');
-
- // nicetable - on mobile shift 'name' col to be a row
- $('.mobile .nicetable th.title').remove();
- $('.mobile .nicetable td.title').each(function(i) {
- $(this).attr('colspan', 5).insertBefore($(this).parent('tr')).wrap('<tr class="heading" />');
- });
},
on_mobile_nav_click: function() {
@@ -805,26 +792,6 @@ $.extend(fixmystreet.set_up, {
});
},
- promo_elements: function() {
- // Add close buttons for .promo's
- if ($('.promo').length) {
- $('.promo').append('<a href="#" class="close-promo">x</a>');
- }
- //only close its own parent
- $('.promo').on('click', '.close-promo', function(e) {
- e.preventDefault();
- $(this).parent('.promo').animate({
- 'height':0,
- 'margin-bottom':0,
- 'padding-top':0,
- 'padding-bottom':0
- },{
- duration:500,
- queue:false
- }).fadeOut(500);
- });
- },
-
ajax_history: function() {
$('#map_sidebar').on('click', '.item-list--reports a', function(e) {
if (e.metaKey || e.ctrlKey) {
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index b9c666da1..b9f71257b 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -1832,67 +1832,6 @@ label .muted {
}
-table.nicetable {
- width:100%;
- margin-bottom:2em;
- thead {
- border-bottom:0.25em solid #ccc;
- th {
- font-size:0.75em;
- }
- }
- tr {
- &.a {
- background:#f6f6f6;
- }
- &.gone {
- color: #666666;
- background-color: #cccccc;
- }
- &:hover {
- background:#FFF5CC;
- cursor:pointer;
- }
- td {
- padding:0.25em;
- a {
- &:hover {
- text-decoration:none;
- }
- }
- }
- }
- .title {
- text-align: $left;
- }
- .data {
- width:12%;
- }
-}
-
-.promo {
- margin: 0 -1em 1em;
- color: $primary_text;
- background: $primary;
- padding:1em;
- overflow:hidden;
- position: relative;
- .close-promo {
- position:absolute;
- top:0.5em;
- #{$right}: 0.5em;
- display:block;
- width:16px;
- height:16px;
- text-indent:-999999px;
- background:url($image-sprite) -341px -263px no-repeat;
- @include border-radius(4px);
- &:hover {
- background:#222 url($image-sprite) -341px -223px no-repeat;
- }
- }
-}
-
.alert {
margin: 0 -1em 1em;
background:#ff0000;
@@ -2408,7 +2347,6 @@ table.nicetable {
}
@import "_admin";
-@import "_fixedthead";
@import "_dropzone";
@import "_multiselect";
@import "_autocomplete";
diff --git a/web/cobrands/sass/_fixedthead.scss b/web/cobrands/sass/_fixedthead.scss
deleted file mode 100644
index c1896e5d8..000000000
--- a/web/cobrands/sass/_fixedthead.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-.js-fixed-thead__clone {
- position: fixed;
- background: #fff;
-} \ No newline at end of file
diff --git a/web/js/jquery.fixedthead.js b/web/js/jquery.fixedthead.js
deleted file mode 100644
index 33e60f721..000000000
--- a/web/js/jquery.fixedthead.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * jQuery.fixedThead.js
- * By Zarino at mySociety
- */
-
-(function ($) {
-
- // Call this on a <thead> element and it'll be given a class
- // of '.js-fixed-thead__clone' when you scroll down. eg:
- // $('#my-table thead').fixedThead()
- //
- // You'll probably want to specify some CSS styles like:
- // .js-fixed-thead__clone { position: fixed; background: #fff; }
-
- $.fn.fixedThead = function() {
-
- var calculateCloneDimensions = function calculateCloneDimensions($originalThead, $cloneThead){
- $cloneThead.css({
- width: $originalThead.width()
- });
-
- $('tr', $originalThead).each(function(tr_index, tr){
- $('th', tr).each(function(th_index, th){
- $cloneThead.find('tr:eq(' + tr_index + ') th:eq(' + th_index + ')').css({
- width: $(th).width()
- });
- });
- });
- }
-
- var showOrHideClone = function showOrHideClone($table, $originalThead, $cloneThead){
- var bounds = $table[0].getBoundingClientRect();
-
- // First we detect whether *any* of the table is visible,
- // then, if it is, we position the fixed thead so that it
- // never extends outside of the table bounds even when the
- // visible portion of the table is shorter than the thead.
-
- if(bounds.top <= 0 && bounds.bottom >= 0){
- $cloneThead.css('display', $originalThead.css('display'));
-
- var rowHeight = $cloneThead.outerHeight();
- if(bounds.bottom < rowHeight){
- $cloneThead.css({
- top: (rowHeight - bounds.bottom) * -1
- });
- } else {
- $cloneThead.css({
- top: 0
- });
- }
-
- } else {
- $cloneThead.css('display', 'none');
- }
- }
-
- return this.each(function() {
- var $originalThead = $(this);
- var $table = $originalThead.parent('table');
- var $cloneThead = $originalThead.clone().addClass('js-fixed-thead__clone');
-
- $cloneThead.insertAfter($originalThead);
- $cloneThead.css('display', 'none');
-
- calculateCloneDimensions($originalThead, $cloneThead);
- showOrHideClone($table, $originalThead, $cloneThead);
-
- $(window).resize(function(){
- calculateCloneDimensions($originalThead, $cloneThead);
- showOrHideClone($table, $originalThead, $cloneThead);
- });
-
- $(window).scroll(function(){
- showOrHideClone($table, $originalThead, $cloneThead);
- });
- });
-
- };
-
-}(jQuery));