Merge branch 'stage4' of bitbucket.org:Bonus_05/expomap into stage4

remotes/origin/mobile_from_stage4
Alexander Burdeiny 10 years ago
commit 2871242e1c
  1. 4
      gulpfile.js
  2. 47
      static/client/css/main.css
  3. 2
      static/client/css/social-likes_flat.css
  4. 3
      static/client/css/vendor.css
  5. 2
      static/client/css_min/main.min.css
  6. 2
      static/client/css_min/vendor.min.css
  7. 637
      static/client/js/social-likes.js
  8. 638
      static/client/js/vendor.js
  9. 14
      static/client/js_min/vendor.min.js
  10. 12
      templates/client/article/article.html
  11. 13
      templates/client/article/news.html
  12. 2
      templates/client/blank.html
  13. 9
      templates/client/conference/conference_detail.html
  14. 9
      templates/client/exposition/exposition_detail.html
  15. 4
      templates/client/includes/conference/conference_object.html
  16. 4
      templates/client/includes/conference/conference_paid.html
  17. 4
      templates/client/includes/exposition/expo_paid.html
  18. 2
      templates/client/includes/exposition/exposition_object.html
  19. 50
      templates/client/includes/sharing_block.html

@ -19,6 +19,7 @@ gulp.task('make-vendor-js', function () {
'static/client/js/jquery.placeholder.js',
'static/client/js/jquery.phototag.js',
'static/client/js/dna0.4.4.min.js',
'static/client/js/social-likes.js',
'static/client/js/main.js',
'static/client/js/scripts.js',
'static/client/js/Base64.js'
@ -40,7 +41,8 @@ gulp.task('make-vendor-css', function () {
'static/client/lib/fancybox/jquery.fancybox.css',
'static/client/css/phototag.css',
'static/client/css/regions.css',
'static/client/css/select2.css'
'static/client/css/select2.css',
'static/client/css/social-likes_flat.css'
])
.pipe(concat('vendor.css'))
.pipe(gulp.dest('static/client/css/'))

@ -5200,6 +5200,14 @@ dl.add-info dd ul li {
font-size: 27px;
margin: 12px 0 10px
}
.i-date:after{
content: "";
display: block;
clear: both;
}
.i-date .sharing_block{
float: right;
}
.i-discount {
margin-top: 15px;
font-size: 10px;
@ -12935,3 +12943,42 @@ button.gray:hover {
margin-right: 22px;
line-height: 1em
}
.sharing_block .social-likes{
margin: 0px;
background: #fff;
min-height: auto;
padding: 5px;
}
.sharing_block .social-likes.fixed{
position: fixed;
top: 0px;
z-index: 1000;
box-shadow: 0px 0px 2px #aaa;
border-radius: 0px 0px 3px 3px;
}
.sharing_block .social-likes__widget{
margin: 0px;
border-radius: 2px;
float: left;
}
.sharing_block .social-likes__widget:not(:first-child){
margin-left: 5px;
}
.sharing_block .social-likes__button{
padding: .04em .15em .18em 1.65em;
}
.news_sharing:after{
content: "";
display: block;
clear: both;
}
.news_sharing .sharing_block {
float: right;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,637 @@
/**
* Social Likes
* http://sapegin.github.com/social-likes
*
* Sharing buttons for Russian and worldwide social networks.
*
* @requires jQuery
* @author Artem Sapegin
* @copyright 2014 Artem Sapegin (sapegin.me)
* @license MIT
*/
/*global define:false, socialLikesButtons:false */
(function(factory) { // Try to register as an anonymous AMD module
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
}
else {
factory(jQuery);
}
}(function($, undefined) {
'use strict';
var prefix = 'social-likes';
var classPrefix = prefix + '__';
var openClass = prefix + '_opened';
var protocol = location.protocol === 'https:' ? 'https:' : 'http:';
var isHttps = protocol === 'https:';
/**
* Buttons
*/
var services = {
facebook: {
// https://developers.facebook.com/docs/reference/fql/link_stat/
counterUrl: 'https://graph.facebook.com/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url%3D%22{url}%22&callback=?',
convertNumber: function(data) {
return data.data[0].total_count;
},
popupUrl: 'https://www.facebook.com/sharer/sharer.php?u={url}',
popupWidth: 600,
popupHeight: 359
},
twitter: {
popupUrl: 'https://twitter.com/intent/tweet?url={url}&text={title}',
popupWidth: 600,
popupHeight: 250,
click: function() {
// Add colon to improve readability
if (!/[\.\?:\-–—]\s*$/.test(this.options.title)) this.options.title += ':';
return true;
}
},
mailru: {
counterUrl: protocol + '//connect.mail.ru/share_count?url_list={url}&callback=1&func=?',
convertNumber: function(data) {
for (var url in data) {
if (data.hasOwnProperty(url)) {
return data[url].shares;
}
}
},
popupUrl: 'https://connect.mail.ru/share?share_url={url}&title={title}',
popupWidth: 492,
popupHeight: 500
},
vkontakte: {
counterUrl: 'https://vk.com/share.php?act=count&url={url}&index={index}',
counter: function(jsonUrl, deferred) {
var options = services.vkontakte;
if (!options._) {
options._ = [];
if (!window.VK) window.VK = {};
window.VK.Share = {
count: function(idx, number) {
options._[idx].resolve(number);
}
};
}
var index = options._.length;
options._.push(deferred);
$.getScript(makeUrl(jsonUrl, {index: index}))
.fail(deferred.reject);
},
popupUrl: 'https://vk.com/share.php?url={url}&title={title}',
popupWidth: 655,
popupHeight: 450
},
odnoklassniki: {
counterUrl: protocol + '//connect.ok.ru/dk?st.cmd=extLike&ref={url}&uid={index}',
counter: function(jsonUrl, deferred) {
var options = services.odnoklassniki;
if (!options._) {
options._ = [];
if (!window.ODKL) window.ODKL = {};
window.ODKL.updateCount = function(idx, number) {
options._[idx].resolve(number);
};
}
var index = options._.length;
options._.push(deferred);
$.getScript(makeUrl(jsonUrl, {index: index}))
.fail(deferred.reject);
},
popupUrl: 'https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&service=odnoklassniki&st.shareUrl={url}',
popupWidth: 580,
popupHeight: 336
},
plusone: {
counterUrl: protocol + '//share.yandex.ru/gpp.xml?url={url}&callback=?',
convertNumber: function(number) {
return parseInt(number.replace(/\D/g, ''), 10);
},
popupUrl: 'https://plus.google.com/share?url={url}',
popupWidth: 500,
popupHeight: 550
},
pinterest: {
counterUrl: protocol + '//api.pinterest.com/v1/urls/count.json?url={url}&callback=?',
convertNumber: function(data) {
return data.count;
},
popupUrl: 'https://pinterest.com/pin/create/button/?url={url}&description={title}',
popupWidth: 740,
popupHeight: 550
}
};
/**
* Counters manager
*/
var counters = {
promises: {},
fetch: function(service, url, extraOptions) {
if (!counters.promises[service]) counters.promises[service] = {};
var servicePromises = counters.promises[service];
if (!extraOptions.forceUpdate && servicePromises[url]) {
return servicePromises[url];
}
else {
var options = $.extend({}, services[service], extraOptions);
var deferred = $.Deferred();
var jsonUrl = options.counterUrl && makeUrl(options.counterUrl, {url: url});
if (jsonUrl && $.isFunction(options.counter)) {
options.counter(jsonUrl, deferred);
}
else if (options.counterUrl) {
$.getJSON(jsonUrl)
.done(function(data) {
try {
var number = data;
if ($.isFunction(options.convertNumber)) {
number = options.convertNumber(data);
}
deferred.resolve(number);
}
catch (e) {
deferred.reject();
}
})
.fail(deferred.reject);
}
else {
deferred.reject();
}
servicePromises[url] = deferred.promise();
return servicePromises[url];
}
}
};
/**
* jQuery plugin
*/
$.fn.socialLikes = function(options) {
return this.each(function() {
var elem = $(this);
var instance = elem.data(prefix);
if (instance) {
if ($.isPlainObject(options)) {
instance.update(options);
}
}
else {
instance = new SocialLikes(elem, $.extend({}, $.fn.socialLikes.defaults, options, dataToOptions(elem)));
elem.data(prefix, instance);
}
});
};
$.fn.socialLikes.defaults = {
url: window.location.href.replace(window.location.hash, ''),
title: document.title,
counters: true,
zeroes: false,
wait: 500, // Show buttons only after counters are ready or after this amount of time
timeout: 10000, // Show counters after this amount of time even if they aren’t ready
popupCheckInterval: 500,
singleTitle: 'Share'
};
function SocialLikes(container, options) {
this.container = container;
this.options = options;
this.init();
}
SocialLikes.prototype = {
init: function() {
// Add class in case of manual initialization
this.container.addClass(prefix);
this.single = this.container.hasClass(prefix + '_single');
this.initUserButtons();
this.countersLeft = 0;
this.number = 0;
this.container.on('counter.' + prefix, $.proxy(this.updateCounter, this));
var buttons = this.container.children();
this.makeSingleButton();
this.buttons = [];
buttons.each($.proxy(function(idx, elem) {
var button = new Button($(elem), this.options);
this.buttons.push(button);
if (button.options.counterUrl) this.countersLeft++;
}, this));
if (this.options.counters) {
this.timer = setTimeout($.proxy(this.appear, this), this.options.wait);
this.timeout = setTimeout($.proxy(this.ready, this, true), this.options.timeout);
}
else {
this.appear();
}
},
initUserButtons: function() {
if (!this.userButtonInited && window.socialLikesButtons) {
$.extend(true, services, socialLikesButtons);
}
this.userButtonInited = true;
},
makeSingleButton: function() {
if (!this.single) return;
var container = this.container;
container.addClass(prefix + '_vertical');
container.wrap($('<div>', {'class': prefix + '_single-w'}));
container.wrapInner($('<div>', {'class': prefix + '__single-container'}));
var wrapper = container.parent();
// Widget
var widget = $('<div>', {
'class': getElementClassNames('widget', 'single')
});
var button = $(template(
'<div class="{buttonCls}">' +
'<span class="{iconCls}"></span>' +
'{title}' +
'</div>',
{
buttonCls: getElementClassNames('button', 'single'),
iconCls: getElementClassNames('icon', 'single'),
title: this.options.singleTitle
}
));
widget.append(button);
wrapper.append(widget);
widget.on('click', function() {
var activeClass = prefix + '__widget_active';
widget.toggleClass(activeClass);
if (widget.hasClass(activeClass)) {
container.css({left: -(container.width()-widget.width())/2, top: -container.height()});
showInViewport(container);
closeOnClick(container, function() {
widget.removeClass(activeClass);
});
}
else {
container.removeClass(openClass);
}
return false;
});
this.widget = widget;
},
update: function(options) {
if (!options.forceUpdate && options.url === this.options.url) return;
// Reset counters
this.number = 0;
this.countersLeft = this.buttons.length;
if (this.widget) this.widget.find('.' + prefix + '__counter').remove();
// Update options
$.extend(this.options, options);
for (var buttonIdx = 0; buttonIdx < this.buttons.length; buttonIdx++) {
this.buttons[buttonIdx].update(options);
}
},
updateCounter: function(e, service, number) {
number = number || 0;
if (number || this.options.zeroes) {
this.number += number;
if (this.single) {
this.getCounterElem().text(this.number);
}
}
if (this.countersLeft === 0) {
this.appear();
this.ready();
}
this.countersLeft--;
},
appear: function() {
this.container.addClass(prefix + '_visible');
},
ready: function(silent) {
if (this.timeout) {
clearTimeout(this.timeout);
}
this.container.addClass(prefix + '_ready');
if (!silent) {
this.container.trigger('ready.' + prefix, this.number);
}
},
getCounterElem: function() {
var counterElem = this.widget.find('.' + classPrefix + 'counter_single');
if (!counterElem.length) {
counterElem = $('<span>', {
'class': getElementClassNames('counter', 'single')
});
this.widget.append(counterElem);
}
return counterElem;
}
};
function Button(widget, options) {
this.widget = widget;
this.options = $.extend({}, options);
this.detectService();
if (this.service) {
this.init();
}
}
Button.prototype = {
init: function() {
this.detectParams();
this.initHtml();
setTimeout($.proxy(this.initCounter, this), 0);
},
update: function(options) {
$.extend(this.options, {forceUpdate: false}, options);
this.widget.find('.' + prefix + '__counter').remove(); // Remove old counter
this.initCounter();
},
detectService: function() {
var service = this.widget.data('service');
if (!service) {
// class="facebook"
var node = this.widget[0];
var classes = node.classList || node.className.split(' ');
for (var classIdx = 0; classIdx < classes.length; classIdx++) {
var cls = classes[classIdx];
if (services[cls]) {
service = cls;
break;
}
}
if (!service) return;
}
this.service = service;
$.extend(this.options, services[service]);
},
detectParams: function() {
var data = this.widget.data();
// Custom page counter URL or number
if (data.counter) {
var number = parseInt(data.counter, 10);
if (isNaN(number)) {
this.options.counterUrl = data.counter;
}
else {
this.options.counterNumber = number;
}
}
// Custom page title
if (data.title) {
this.options.title = data.title;
}
// Custom page URL
if (data.url) {
this.options.url = data.url;
}
},
initHtml: function() {
var options = this.options;
var widget = this.widget;
// Old initialization HTML
var a = widget.find('a');
if (a.length) {
this.cloneDataAttrs(a, widget);
}
// Button
var button = $('<span>', {
'class': this.getElementClassNames('button'),
'html': widget.html()
});
if (options.clickUrl) {
var url = makeUrl(options.clickUrl, {
url: options.url,
title: options.title
});
var link = $('<a>', {
href: url
});
this.cloneDataAttrs(widget, link);
widget.replaceWith(link);
this.widget = widget = link;
}
else {
widget.on('click', $.proxy(this.click, this));
}
widget.removeClass(this.service);
widget.addClass(this.getElementClassNames('widget'));
// Icon
button.prepend($('<span>', {'class': this.getElementClassNames('icon')}));
widget.empty().append(button);
this.button = button;
},
initCounter: function() {
if (this.options.counters) {
if (this.options.counterNumber) {
this.updateCounter(this.options.counterNumber);
}
else {
var extraOptions = {
counterUrl: this.options.counterUrl,
forceUpdate: this.options.forceUpdate
};
counters.fetch(this.service, this.options.url, extraOptions)
.always($.proxy(this.updateCounter, this));
}
}
},
cloneDataAttrs: function(source, destination) {
var data = source.data();
for (var key in data) {
if (data.hasOwnProperty(key)) {
destination.data(key, data[key]);
}
}
},
getElementClassNames: function(elem) {
return getElementClassNames(elem, this.service);
},
updateCounter: function(number) {
number = parseInt(number, 10) || 0;
var params = {
'class': this.getElementClassNames('counter'),
'text': number
};
if (!number && !this.options.zeroes) {
params['class'] += ' ' + prefix + '__counter_empty';
params.text = '';
}
var counterElem = $('<span>', params);
this.widget.append(counterElem);
this.widget.trigger('counter.' + prefix, [this.service, number]);
},
click: function(e) {
var options = this.options;
var process = true;
if ($.isFunction(options.click)) {
process = options.click.call(this, e);
}
if (process) {
var url = makeUrl(options.popupUrl, {
url: options.url,
title: options.title
});
url = this.addAdditionalParamsToUrl(url);
this.openPopup(url, {
width: options.popupWidth,
height: options.popupHeight
});
}
return false;
},
addAdditionalParamsToUrl: function(url) {
var params = $.param($.extend(this.widget.data(), this.options.data));
if ($.isEmptyObject(params)) return url;
var glue = url.indexOf('?') === -1 ? '?' : '&';
return url + glue + params;
},
openPopup: function(url, params) {
var left = Math.round(screen.width/2 - params.width/2);
var top = 0;
if (screen.height > params.height) {
top = Math.round(screen.height/3 - params.height/2);
}
var win = window.open(url, 'sl_' + this.service, 'left=' + left + ',top=' + top + ',' +
'width=' + params.width + ',height=' + params.height + ',personalbar=0,toolbar=0,scrollbars=1,resizable=1');
if (win) {
win.focus();
this.widget.trigger('popup_opened.' + prefix, [this.service, win]);
var timer = setInterval($.proxy(function() {
if (!win.closed) return;
clearInterval(timer);
this.widget.trigger('popup_closed.' + prefix, this.service);
}, this), this.options.popupCheckInterval);
}
else {
location.href = url;
}
}
};
/**
* Helpers
*/
// Camelize data-attributes
function dataToOptions(elem) {
function upper(m, l) {
return l.toUpper();
}
var options = {};
var data = elem.data();
for (var key in data) {
var value = data[key];
if (value === 'yes') value = true;
else if (value === 'no') value = false;
options[key.replace(/-(\w)/g, upper)] = value;
}
return options;
}
function makeUrl(url, context) {
return template(url, context, encodeURIComponent);
}
function template(tmpl, context, filter) {
return tmpl.replace(/\{([^\}]+)\}/g, function(m, key) {
// If key doesn't exists in the context we should keep template tag as is
return key in context ? (filter ? filter(context[key]) : context[key]) : m;
});
}
function getElementClassNames(elem, mod) {
var cls = classPrefix + elem;
return cls + ' ' + cls + '_' + mod;
}
function closeOnClick(elem, callback) {
function handler(e) {
if ((e.type === 'keydown' && e.which !== 27) || $(e.target).closest(elem).length) return;
elem.removeClass(openClass);
doc.off(events, handler);
if ($.isFunction(callback)) callback();
}
var doc = $(document);
var events = 'click touchstart keydown';
doc.on(events, handler);
}
function showInViewport(elem) {
var offset = 10;
if (document.documentElement.getBoundingClientRect) {
var left = parseInt(elem.css('left'), 10);
var top = parseInt(elem.css('top'), 10);
var rect = elem[0].getBoundingClientRect();
if (rect.left < offset)
elem.css('left', offset - rect.left + left);
else if (rect.right > window.innerWidth - offset)
elem.css('left', window.innerWidth - rect.right - offset + left);
if (rect.top < offset)
elem.css('top', offset - rect.top + top);
else if (rect.bottom > window.innerHeight - offset)
elem.css('top', window.innerHeight - rect.bottom - offset + top);
}
elem.addClass(openClass);
}
/**
* Auto initialization
*/
$(function() {
$('.' + prefix).socialLikes();
});
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,7 +1,14 @@
{% extends 'base_catalog.html' %}
{% load static %}
{% load static thumbnail %}
{% load i18n %}
{% block og %}
<meta property="og:image" content="{% thumbnail object.logo '500' %}">
<meta property="og:title" content="{{ object.main_title }}">
<meta property="og:description" content="{{ object.description|safe|striptags|truncatewords:'30' }}">
<meta property="og:url" content="{{ request.build_absolute_uri }}">
{% endblock %}
{% block bread_scrumbs %}
<div class="bread-crumbs">
<a href="/">{% trans 'Главная страница' %}</a>
@ -23,6 +30,9 @@
{% if request.user.is_admin %}
<a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a>
{% endif %}
<div class="news_sharing">
{% include "client/includes/sharing_block.html" %}
</div>
<p style="text-align: justify" align="justify">&nbsp;</p>
</div>
<div class="content-text">

@ -1,7 +1,14 @@
{% extends 'base_catalog.html' %}
{% load static %}
{% load static thumbnail %}
{% load i18n %}
{% block og %}
<meta property="og:image" content="{% thumbnail object.logo '500' %}">
<meta property="og:title" content="{{ object.main_title }}">
<meta property="og:description" content="{{ object.description|safe|striptags|truncatewords:'30' }}">
<meta property="og:url" content="{{ request.build_absolute_uri }}">
{% endblock %}
{% block bread_scrumbs %}
<div class="bread-crumbs">
<a href="/">{% trans 'Главная страница' %}</a>
@ -20,10 +27,14 @@
{% include 'includes/article/article_logo.html' with obj=object %}
<h1>{{ object.main_title }}</h1>
<strong><span>{{ object.publish_date|date:"d E Y" }}</span>{% if object.get_event %}<a class="flag" href="{{ object.get_event.get_permanent_url }}" title="">{{ object.get_event.name }}</a>{% endif %}</strong>
{% if request.user.is_admin %}
<a target="_blank" class="button green " href="/admin/article/news/{{ object.slug }}/">{% trans 'изменить' %}</a>
{% endif %}
<div class="news_sharing">
{% include "client/includes/sharing_block.html" %}
</div>
</div>
<div class="content-text">
{{ object.description|safe }}

@ -27,6 +27,8 @@ This template include basic anf main styles and js files,
<link rel="icon" href="{% static 'client/img/favicon.ico' %}" type="image/x-icon" />
<link rel="shortcut icon" href="{% static 'client/img/favicon.ico' %}" type="image/x-icon" />
{% block og %}{% endblock %}
{% if request.GET.debug == '1' %}
<link rel="stylesheet" href="{% static 'client/css/vendor.css' %}">
{% else %}

@ -1,5 +1,12 @@
{% extends 'base_catalog.html' %}
{% load i18n %}
{% load i18n thumbnail %}
{% block og %}
<meta property="og:image" content="//{{ request.get_host }}{% thumbnail object.get_logo '500' %}">
<meta property="og:title" content="{{ object.name }}">
<meta property="og:description" content="{{ object.main_title }}">
<meta property="og:url" content="{{ request.build_absolute_uri }}">
{% endblock %}
{% block bread_scrumbs %}
<div class="bread-crumbs">

@ -1,6 +1,13 @@
{% extends 'client/base_catalog.html' %}
{% load i18n %}
{% load template_filters %}
{% load template_filters thumbnail %}
{% block og %}
<meta property="og:image" content="{% thumbnail object.get_logo '500' %}">
<meta property="og:title" content="{{ object.name }}">
<meta property="og:description" content="{{ object.main_title }}">
<meta property="og:url" content="{{ request.build_absolute_uri }}">
{% endblock %}
{% block bread_scrumbs %}
<div class="bread-crumbs">

@ -46,6 +46,8 @@
{% with obj=event %}
{% include 'client/includes/show_date_block.html' %}
{% endwith %}
{% include "client/includes/sharing_block.html" %}
</div>
{% if event.place %}
<div class="i-address">
@ -212,7 +214,7 @@
{% include "client/includes/article/articles_in_event.html" with event=event news_list=news %}
<hr />
<div class="i-members clearfix">
<div class="im-participants">
{% with companies=event.company.all|slice:":6" %}

@ -54,6 +54,8 @@
{% with obj=event %}
{% include 'client/includes/show_date_block.html' %}
{% endwith %}
{% include "client/includes/sharing_block.html" %}
</div>
{% if event.place %}
<div class="i-address">
@ -245,7 +247,7 @@
{% include "client/includes/article/articles_in_event.html" with event=event news_list=news %}
<hr />
<div class="i-members clearfix">
<div class="im-participants">
{% with companies=event.company.all|slice:":6" %}

@ -52,6 +52,8 @@
{% with obj=exposition %}
{% include 'client/includes/show_date_block.html' %}
{% endwith %}
{% include "client/includes/sharing_block.html" %}
</div>
{% if exposition.place %}
<div class="i-address">
@ -323,7 +325,7 @@
{% include 'client/includes/booking_block.html' with city=exposition.city place=exposition.place event=exposition %}
<hr />
{% if exposition.get_nearest_events|slice:":6" %}
<div class="e-cat">
<h2 class="sect-title">{% trans 'Ближайшие выставки по тематике' %} <a href="{{ expo_catalog }}theme/{{ exposition.theme.all.0.url }}">«{{ exposition.theme.all.0 }}»</a></h2>

@ -49,6 +49,8 @@
{% with obj=exposition %}
{% include 'client/includes/show_date_block.html' %}
{% endwith %}
{% include "client/includes/sharing_block.html" %}
</div>
{% if exposition.place %}
<div class="i-address">

@ -0,0 +1,50 @@
<div class="sharing_block">
<div class="social-likes">
<div class="vkontakte" title="Поделиться ссылкой во Вконтакте"></div>
<div class="facebook" title="Поделиться ссылкой на Фейсбуке"></div>
<div class="odnoklassniki" title="Поделиться ссылкой в Одноклассниках"></div>
<div class="mailru" title="Поделиться ссылкой в Моём мире"></div>
<div class="twitter" title="Поделиться ссылкой в Твиттере"></div>
</div>
</div>
<script>
// $(function(){
// var ot = $('.sharing_block').offset().top,
// left = $('.sharing_block .social-likes').offset();
// console.log(left)
// $(window).scroll(function(event) {
// if( $(window).scrollTop() >= ot + 5 ){
// $('.sharing_block .social-likes').css({
// position: 'fixed',
// top: '5px',
// left: left + 'px'
// });//.addClass('fixed');
// } else {
// $('.sharing_block .social-likes').css('position', 'static')//.removeClass('fixed');
// }
// });
// })
$('.social-likes').on('ready.social-likes', function(event, number) {
// number is total number of shares
var $sl = $('.sharing_block .social-likes'),
ot = $('.sharing_block').offset().top,
left = $sl.offset().left;
$('.sharing_block').height($sl.outerHeight());
$(window).scroll(function(event) {
if( $(window).scrollTop() >= ot ){
$sl.css({
left: left + 'px'
}).addClass('fixed');
} else {
$sl.removeClass('fixed');
}
});
});
</script>
Loading…
Cancel
Save