mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 01:14:56 +08:00
FEATURE: add real date of post in the share dialog when triggered from the post date
This commit is contained in:
parent
a63ac64931
commit
2abcbcc29b
|
@ -1,4 +1,9 @@
|
|||
<h3>{{view.title}}</h3>
|
||||
|
||||
{{#if date}}
|
||||
<span class="date">{{rawDate date}}</span>
|
||||
{{/if}}
|
||||
|
||||
<div><input type='text' /></div>
|
||||
|
||||
{{#each shareLinks}}
|
||||
|
|
|
@ -57,8 +57,9 @@ Discourse.ShareView = Discourse.View.extend({
|
|||
$shareLink = $('#share-link');
|
||||
var url = $currentTarget.data('share-url');
|
||||
var postNumber = $currentTarget.data('post-number');
|
||||
// Relative urls
|
||||
var date = $currentTarget.children().data('time');
|
||||
|
||||
// Relative urls
|
||||
if (url.indexOf("/") === 0) {
|
||||
url = window.location.protocol + "//" + window.location.host + url;
|
||||
}
|
||||
|
@ -82,8 +83,11 @@ Discourse.ShareView = Discourse.View.extend({
|
|||
left: "" + x + "px",
|
||||
top: "" + y + "px"
|
||||
});
|
||||
|
||||
shareView.set('controller.link', url);
|
||||
shareView.set('controller.postNumber', postNumber);
|
||||
shareView.set('controller.date', date);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
@ -102,5 +106,3 @@ Discourse.ShareView = Discourse.View.extend({
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -635,15 +635,20 @@ iframe {
|
|||
width: 365px;
|
||||
margin-left: -4px;
|
||||
|
||||
h3 {
|
||||
margin: 5px 0;
|
||||
}
|
||||
h3 {
|
||||
margin: 5px 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
font-size: 16px;
|
||||
width: 92%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.date {
|
||||
float: right;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
font-size: 16px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.post-select {
|
||||
|
|
Loading…
Reference in New Issue
Block a user