-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
70 lines (64 loc) · 2.3 KB
/
Copy pathapp.js
File metadata and controls
70 lines (64 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
requirejs.config({
baseUrl: 'ext',
paths: {
mn: "../mn",
util: "../util",
},
shim: {
"shortcut": {
exports: "shortcut"
}
//, "materialize" : ["jquery"]
}
});
require(["vue", "mn", "util"], function(Vue, mn, $m) {
window.mn = mn;
window.Vue = Vue;
window.$m = $m;
window.app = new Vue({
el: '#app',
data: {
title : "mininote is loading..",
todos : [],
topNavi : "arrow_upward",
addBtn : "새글",
mn : mn,
top : "", // noteContent 의 스크롤 위치
},
methods: {
mouseenter : function(){
return; // mac 에서 항상 스크롤 보이기 설정을 해두니 문제가 별로 안되는 것 같아서 일단 막아둠..18/04/16
// noteContent 영역 안에서는 뒤에 목록 스크롤이 발생하지 않도록 처리
this.top = document.documentElement.scrollTop;
$m("body").css("top", -(this.top) + "px").addClass("noscroll");
},
mouseleave : function(){
return; // mac 에서 항상 스크롤 보이기 설정을 해두니 문제가 별로 안되는 것 같아서 일단 막아둠.. 18/04/16
// noteContent 영역 밖에서는 목록 스크롤이 가능하도록 처리
$m("body").removeClass("noscroll");
$(document).scrollTop(this.top);
},
contextClick : function(event){
var contextBtn = $(event.target);
if (contextBtn.text() === "<<") {
contextBtn.parent().animate({left: "-100px"}, 300, function () {
contextBtn.text(">>");
});
} else {
contextBtn.parent().animate({left: "0px"}, 300, function () {
contextBtn.text("<<");
});
}
},
},
computed : {
editMode : function(){
return this.topNavi === '목록';
}
},
watch: {
}
});
//window.onload = mn.init; // 모바일 사파리에서 실행시점이 안 맞을 때가 있는 거 같음..
mn.init();
});