mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge branch 'master' into ja-fix-cursor-on-resize
This commit is contained in:
commit
c1a2779d9e
7 changed files with 41 additions and 17 deletions
|
@ -53,7 +53,11 @@ module.exports =
|
||||||
if req.body.login_after
|
if req.body.login_after
|
||||||
UserGetter.getUser user_id, {email: 1}, (err, user) ->
|
UserGetter.getUser user_id, {email: 1}, (err, user) ->
|
||||||
return next(err) if err?
|
return next(err) if err?
|
||||||
AuthenticationController.doLogin {email:user.email, password: password}, req, res, next
|
AuthenticationController.afterLoginSessionSetup req, user, (err) ->
|
||||||
|
if err?
|
||||||
|
logger.err {err, email: user.email}, "Error setting up session after setting password"
|
||||||
|
return next(err)
|
||||||
|
res.json {redir: AuthenticationController._getRedirectFromSession(req) || "/project"}
|
||||||
else
|
else
|
||||||
res.sendStatus 200
|
res.sendStatus 200
|
||||||
else
|
else
|
||||||
|
|
|
@ -5,12 +5,13 @@ define [
|
||||||
restrict: "A"
|
restrict: "A"
|
||||||
link: (scope, el) ->
|
link: (scope, el) ->
|
||||||
resetHeight = () ->
|
resetHeight = () ->
|
||||||
el.css("height", "auto")
|
curHeight = el.outerHeight()
|
||||||
el.css("height", el.prop("scrollHeight"))
|
fitHeight = el.prop("scrollHeight")
|
||||||
|
|
||||||
|
if fitHeight > curHeight and el.val() != ""
|
||||||
|
scope.$emit "expandable-text-area:resize"
|
||||||
|
el.css("height", fitHeight)
|
||||||
|
|
||||||
scope.$watch (() -> el.val()), resetHeight
|
scope.$watch (() -> el.val()), resetHeight
|
||||||
|
|
||||||
resetHeight()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,9 @@ define [
|
||||||
@gotoOffset(offset)
|
@gotoOffset(offset)
|
||||||
, 10 # Hack: Must happen after @gotoStoredPosition
|
, 10 # Hack: Must happen after @gotoStoredPosition
|
||||||
|
|
||||||
|
@$scope.$on "#{@$scope.name}:clearSelection", (e) =>
|
||||||
|
@editor.selection.clearSelection()
|
||||||
|
|
||||||
storeScrollTopPosition: (session) ->
|
storeScrollTopPosition: (session) ->
|
||||||
if @doc_id?
|
if @doc_id?
|
||||||
docPosition = @localStorage("doc.position.#{@doc_id}") || {}
|
docPosition = @localStorage("doc.position.#{@doc_id}") || {}
|
||||||
|
|
|
@ -33,6 +33,10 @@ define [
|
||||||
$scope.$on "layout:pdf:resize", (event, state) ->
|
$scope.$on "layout:pdf:resize", (event, state) ->
|
||||||
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
|
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
|
||||||
|
|
||||||
|
$scope.$on "expandable-text-area:resize", (event) ->
|
||||||
|
$timeout () ->
|
||||||
|
$scope.$broadcast "review-panel:layout"
|
||||||
|
|
||||||
$scope.$watch "ui.pdfLayout", (layout) ->
|
$scope.$watch "ui.pdfLayout", (layout) ->
|
||||||
$scope.reviewPanel.layoutToLeft = (layout == "flat")
|
$scope.reviewPanel.layoutToLeft = (layout == "flat")
|
||||||
|
|
||||||
|
@ -306,6 +310,7 @@ define [
|
||||||
$http.post("/project/#{$scope.project_id}/thread/#{thread_id}/messages", {content, _csrf: window.csrfToken})
|
$http.post("/project/#{$scope.project_id}/thread/#{thread_id}/messages", {content, _csrf: window.csrfToken})
|
||||||
.error (error) ->
|
.error (error) ->
|
||||||
ide.showGenericMessageModal("Error submitting comment", "Sorry, there was a problem submitting your comment")
|
ide.showGenericMessageModal("Error submitting comment", "Sorry, there was a problem submitting your comment")
|
||||||
|
$scope.$broadcast "editor:clearSelection"
|
||||||
$timeout () ->
|
$timeout () ->
|
||||||
$scope.$broadcast "review-panel:layout"
|
$scope.$broadcast "review-panel:layout"
|
||||||
event_tracking.sendMB "rp-new-comment", { size: content.length }
|
event_tracking.sendMB "rp-new-comment", { size: content.length }
|
||||||
|
|
BIN
services/web/public/img/about/joe_green.jpg
Normal file
BIN
services/web/public/img/about/joe_green.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
|
@ -451,6 +451,8 @@
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
color: @rp-type-darkgrey;
|
color: @rp-type-darkgrey;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
min-height: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rp-icon-delete {
|
.rp-icon-delete {
|
||||||
|
|
|
@ -145,18 +145,27 @@ describe "PasswordResetController", ->
|
||||||
done()
|
done()
|
||||||
@PasswordResetController.setNewUserPassword @req, @res
|
@PasswordResetController.setNewUserPassword @req, @res
|
||||||
|
|
||||||
it "should login user if login_after is set", (done) ->
|
describe 'when login_after is set', ->
|
||||||
@UserGetter.getUser = sinon.stub().callsArgWith(2, null, { email: "joe@example.com" })
|
|
||||||
@PasswordResetHandler.setNewUserPassword.callsArgWith(2, null, true, @user_id = "user-id-123")
|
beforeEach ->
|
||||||
@req.body.login_after = "true"
|
@UserGetter.getUser = sinon.stub().callsArgWith(2, null, { email: "joe@example.com" })
|
||||||
@AuthenticationController.doLogin = (options, req, res, next)=>
|
@PasswordResetHandler.setNewUserPassword.callsArgWith(2, null, true, @user_id = "user-id-123")
|
||||||
@UserGetter.getUser.calledWith(@user_id).should.equal true
|
@req.body.login_after = "true"
|
||||||
expect(options).to.deep.equal {
|
@res.json = sinon.stub()
|
||||||
email: "joe@example.com",
|
@AuthenticationController.afterLoginSessionSetup = sinon.stub().callsArgWith(2, null)
|
||||||
password: @password
|
@AuthenticationController._getRedirectFromSession = sinon.stub().returns('/some/path')
|
||||||
}
|
|
||||||
|
it "should login user if login_after is set", (done) ->
|
||||||
|
@PasswordResetController.setNewUserPassword @req, @res
|
||||||
|
@AuthenticationController.afterLoginSessionSetup.callCount.should.equal 1
|
||||||
|
@AuthenticationController.afterLoginSessionSetup.calledWith(
|
||||||
|
@req,
|
||||||
|
{email: 'joe@example.com'}
|
||||||
|
).should.equal true
|
||||||
|
@AuthenticationController._getRedirectFromSession.callCount.should.equal 1
|
||||||
|
@res.json.callCount.should.equal 1
|
||||||
|
@res.json.calledWith({redir: '/some/path'}).should.equal true
|
||||||
done()
|
done()
|
||||||
@PasswordResetController.setNewUserPassword @req, @res
|
|
||||||
|
|
||||||
describe "renderSetPasswordForm", ->
|
describe "renderSetPasswordForm", ->
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue