* working on checkboxes
This commit is contained in:
parent
52f783f70e
commit
ca7a69a465
|
|
@ -6,7 +6,22 @@
|
|||
var logger = context.JK.logger;
|
||||
var rest = context.JK.Rest();
|
||||
|
||||
function socialShare() {
|
||||
var shareWithFacebook = $('.share-with-facebook').is(':checked');
|
||||
var shareWithGoogle = $('.share-with-google').is(':checked');
|
||||
var shareWithTwitter = $('.share-with-twitter').is(':checked');
|
||||
|
||||
if(!shareWithFacebook && !shareWithGoogle && !shareWithTwitter) {
|
||||
$('.share-options').addClass('error')
|
||||
}
|
||||
}
|
||||
function registerEvents(onOff) {
|
||||
|
||||
$('#dialog-share-button').unbind('click').click(function(e){
|
||||
socialShare();
|
||||
return false;
|
||||
});
|
||||
|
||||
if (onOff) {
|
||||
|
||||
}
|
||||
|
|
@ -146,6 +161,7 @@
|
|||
}
|
||||
|
||||
function beforeShow() {
|
||||
$('.share-with-selectors').removeClass('error');
|
||||
registerEvents(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -192,3 +192,25 @@ img.space {
|
|||
-moz-border-radius:18px;
|
||||
border-radius:18px;
|
||||
}
|
||||
|
||||
.share-options {
|
||||
.error-msg {
|
||||
display:none;
|
||||
margin-top:10px;
|
||||
text-align:center;
|
||||
color:#F00;
|
||||
font-size:11px;
|
||||
}
|
||||
}
|
||||
|
||||
.share-options.error {
|
||||
|
||||
background-color: #330000;
|
||||
border: 1px solid #990000;
|
||||
padding:4px;
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
display:block;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,20 +7,21 @@
|
|||
<tr>
|
||||
<td valign="top" width="45%" class="border-right"><h3 class="mb5">Share to Social Media:</h3>
|
||||
<textarea class="w95" rows="3">Add a Message...</textarea><br />
|
||||
<div class="left">
|
||||
<div class="left share-options">
|
||||
<input type="checkbox" />
|
||||
<%= image_tag "content/icon_facebook.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle" %>
|
||||
<%= image_tag "content/icon_facebook.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle", :class => "share-with-facebook" %>
|
||||
<input type="checkbox" />
|
||||
<%= image_tag "content/icon_twitter.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle" %>
|
||||
<%= image_tag "content/icon_twitter.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle", :class => "share-with-twitter" %>
|
||||
<input type="checkbox" />
|
||||
<%= image_tag "content/icon_google.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle" %>
|
||||
<%= image_tag "content/icon_google.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle", :class => "share-with-google" %>
|
||||
<div class="error-msg"
|
||||
</div>
|
||||
<div class=" right mr10 mt5"><a class="button-orange" id="dialog-share-button">SHARE</a></div>
|
||||
</td>
|
||||
<td valign="top" width="48%">
|
||||
<div class="ml10">
|
||||
<h3>Share a Link:</h3><br />
|
||||
<% unless true # share_token.blank? %>
|
||||
<% unless # share_token.blank? %>
|
||||
<%= "#{root_url}#{share_token}" %>
|
||||
<% end %>
|
||||
<div class="right"><a class="button-orange">COPY LINK</a></div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue