Merge branch 'master' of github.com:discourse/discourse

This commit is contained in:
Sam 2018-06-14 15:55:15 +10:00
commit 2ddf8ea0f8
5 changed files with 19 additions and 9 deletions

View File

@ -63,6 +63,9 @@ export default Ember.Component.extend({
if ( !$target.is('.widget-button') &&
!$parents.is('.widget-button') &&
!$parents.is('.dropdown-menu') &&
!$parents.is('#discourse-modal') &&
!$target.is('#discourse-modal') &&
!$parents.is('.modal-footer') &&
(
$target.is('.topic-timeline') ||
!$parents.is('#topic-progress-wrapper')

View File

@ -4,6 +4,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
model: null,
postNumber: null,
onShow: () => {
Ember.run.next(() => $('#post-jump').focus());
},
actions: {
jump() {
const max = this.get("topic.postStream.filteredPostsCount");

View File

@ -13,6 +13,7 @@ import { extractLinkMeta } from 'discourse/lib/render-topic-featured-link';
import { popupAjaxError } from 'discourse/lib/ajax-error';
import { spinnerHTML } from 'discourse/helpers/loading-spinner';
import { userPath } from 'discourse/lib/url';
import showModal from 'discourse/lib/show-modal';
let customPostMessageCallbacks = {};
@ -469,13 +470,15 @@ export default Ember.Controller.extend(BufferedContent, {
},
jumpToPostPrompt() {
const postText = prompt(I18n.t('topic.progress.jump_prompt_long'));
if (postText === null) { return; }
const postIndex = parseInt(postText, 10);
if (postIndex === 0) { return; }
this._jumpToIndex(postIndex);
const topic = this.get('model');
const controller = showModal('jump-to-post');
controller.setProperties({
topic: topic,
postNumber: null,
jumpToIndex: (index) => {
this.send('jumpToIndex', index);
}
});
},
jumpToPost(postNumber) {

View File

@ -1,5 +1,5 @@
{{#d-modal-body title="topic.progress.jump_prompt_long"}}
{{text-field value=postNumber insert-newline="jump"}}
{{input id="post-jump" type="number" value=postNumber insert-newline="jump"}}
<span class='input-hint-text'>
{{i18n "topic.progress.jump_prompt_of" count=topic.postStream.filteredPostsCount}}
</span>

View File

@ -67,7 +67,6 @@ $line-height-large: 1.4; // Normal or small text
$z-layers: (
"max": 9999,
"fullscreen": 1700,
"modal": (
"tooltip": 1600,
"popover": 1500,
@ -75,6 +74,7 @@ $z-layers: (
"content": 1300,
"overlay": 1200
),
"fullscreen": 1150,
"mobile-composer": 1100,
"header": 1000,
"tooltip": 600,