Merge branch 'phone_like_fix'

This commit is contained in:
yafeilee 2014-05-19 22:02:42 +08:00
commit d9255068b7
4 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,5 @@
@app.controller 'ArchivesController',[ '$scope', '$http', '$location', '$timeout', '$cookies', ($scope, $http, $location, $timeout, $cookies)->
url = $location.absUrl() + ".json"
url = window.location.pathname + ".json"
start_with = $cookies.start_with if window.location.pathname == $cookies.start_with_type
$http
url: url

View File

@ -1,14 +1,18 @@
@app.controller 'CommentsController', ['$scope', '$http', '$location', '$timeout', ($scope, $http, $location, $timeout)->
url = $location.absUrl() + "/comments.json"
@app.controller 'CommentsController', ['$scope', '$http', '$location', '$timeout', '$cookies', ($scope, $http, $location, $timeout, $cookies)->
url = window.location.pathname + "/comments.json"
$scope.name = $cookies.name
$scope.email = $cookies.email
$http.get(url).success (data)->
console.log data
$scope.comments = data
$scope.publish_success = null
$scope.submit = ->
$scope.submitting = true
$cookies.name = $scope.name
$cookies.email = $scope.email
comment = { content: $scope.content, name: $scope.name, email: $scope.email }
$http.post(url, comment)
.success (res)->

View File

@ -1,5 +1,5 @@
@app.controller 'LikesController', ['$scope', '$http', '$location', '$cookies', ($scope, $http, $location, $cookies)->
url = $location.absUrl() + "/likes"
url = window.location.pathname + "/likes"
$http.get url
.success (res)->
@ -9,7 +9,7 @@
if $scope.like
$http
url: $location.absUrl() + "/likes/#{$scope.like}/is_liked"
url: window.location.pathname + "/likes/#{$scope.like}/is_liked"
method: 'GET'
.success (res)->
if res == 'true'

View File

@ -29,7 +29,7 @@
line-height: 1.5;
white-space: pre;
word-wrap: normal;
overflow-x: scroll;
overflow-x: auto;
}
code {