From aecc57e3bbca70db661d2a60dbf9ea498b153fd4 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 21 Oct 2015 16:35:46 -0700 Subject: [PATCH] class funkiness --- .../src/js/components/AnchorComponent.coffee | 2 +- pub/tree/src/js/components/BodyComponent.coffee | 10 ++++++---- pub/tree/src/js/main.js | 17 ++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pub/tree/src/js/components/AnchorComponent.coffee b/pub/tree/src/js/components/AnchorComponent.coffee index d3db56ca6..a56c8b5d3 100644 --- a/pub/tree/src/js/components/AnchorComponent.coffee +++ b/pub/tree/src/js/components/AnchorComponent.coffee @@ -129,7 +129,7 @@ module.exports = query { reset: -> $("html,body").animate {scrollTop:0} - $("#cont").attr 'class','' + # $("#cont").attr 'class','' $('#nav').attr 'style','' $('#nav').removeClass 'scrolling m-up' $('#nav').addClass 'm-down m-fixed' diff --git a/pub/tree/src/js/components/BodyComponent.coffee b/pub/tree/src/js/components/BodyComponent.coffee index 13667446f..550fa4107 100644 --- a/pub/tree/src/js/components/BodyComponent.coffee +++ b/pub/tree/src/js/components/BodyComponent.coffee @@ -1,3 +1,5 @@ +clas = require 'classnames' + logo = require './Logo.coffee' query = require './Async.coffee' reactify = require './Reactify.coffee' @@ -44,9 +46,7 @@ module.exports = query { }, recl displayName: "Body" render: -> - $("#cont").attr 'class','' - if @props.meta.layout - $("#cont").attr 'class',@props.meta.layout.replace /,/g," " + className = (@props.meta.layout?.replace() /,/g," ") || "" body = [reactify @props.body] if @props.meta.logo? body.unshift (Logo color:@props.meta.logo) @@ -57,5 +57,7 @@ module.exports = query { (p {}, "This page was served by Urbit.")]) (div { id:'body', - key:"body"+@props.path}, + key:"body"+@props.path + className + }, body) diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 2e3cf880b..6e3fc876a 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -268,7 +268,6 @@ module.exports = query({ $("html,body").animate({ scrollTop: 0 }); - $("#cont").attr('class', ''); $('#nav').attr('style', ''); $('#nav').removeClass('scrolling m-up'); return $('#nav').addClass('m-down m-fixed'); @@ -426,7 +425,9 @@ module.exports = function(queries, Child, load) { },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":22,"./LoadComponent.coffee":10}],4:[function(require,module,exports){ -var Logo, Next, a, div, img, logo, p, query, reactify, recl, ref; +var Logo, Next, a, clas, div, img, logo, p, query, reactify, recl, ref; + +clas = require('classnames'); logo = require('./Logo.coffee'); @@ -495,11 +496,8 @@ module.exports = query({ }, recl({ displayName: "Body", render: function() { - var body; - $("#cont").attr('class', ''); - if (this.props.meta.layout) { - $("#cont").attr('class', this.props.meta.layout.replace(/,/g, " ")); - } + var body, className, ref1; + className = ((ref1 = this.props.meta.layout) != null ? ref1.replace()(/,/g, " ") : void 0) || ""; body = [reactify(this.props.body)]; if (this.props.meta.logo != null) { body.unshift(Logo({ @@ -519,14 +517,15 @@ module.exports = query({ } return div({ id: 'body', - key: "body" + this.props.path + key: "body" + this.props.path, + className: className }, body); } })); -},{"./Async.coffee":3,"./Logo.coffee":11,"./Reactify.coffee":12}],5:[function(require,module,exports){ +},{"./Async.coffee":3,"./Logo.coffee":11,"./Reactify.coffee":12,"classnames":17}],5:[function(require,module,exports){ var div, recl, ref, textarea; recl = React.createClass;