书签详情定位
This commit is contained in:
parent
52b870ac52
commit
3cb2187254
|
|
@ -215,6 +215,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
|
|||
note.content = $scope.content;
|
||||
note.tagName = tagName;
|
||||
note.tag_id = $scope.currentTagId;
|
||||
toPos(note.id);
|
||||
}
|
||||
})
|
||||
$scope.add = false;
|
||||
|
|
@ -270,10 +271,10 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
|
|||
var detail = note.detail;
|
||||
$scope.notes.forEach((note) => {
|
||||
note.detail = false;
|
||||
$("#" + note.id).removeClass("secondary")
|
||||
$("#" + note.id).removeClass("secondary");
|
||||
})
|
||||
note.detail = !detail;
|
||||
note.detail && $("#" + note.id).addClass("secondary")
|
||||
note.detail && $("#" + note.id).addClass("secondary") && toPos(note.id);
|
||||
}
|
||||
if (flag) {
|
||||
$event && $event.stopPropagation();
|
||||
|
|
@ -387,4 +388,10 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
|
|||
duration: 500,
|
||||
});
|
||||
}
|
||||
|
||||
function toPos(id) {
|
||||
setTimeout(function(){
|
||||
$('html,body').animate({ scrollTop: $('#' + id).offset().top - 20 }, 100);
|
||||
}, 36);
|
||||
}
|
||||
}]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue