Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
amranidev committed Apr 4, 2016
1 parent 89bdd10 commit 2896c2a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions public/js/scaffold-interface-js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function inArray(needle, haystack) {
var length = haystack.length;
for (var i = 0; i < length; i++) {
if (haystack[i].onData == needle) return true;
if (haystack[i].table == needle) return true;
}
return false;
}
Expand All @@ -19,7 +20,6 @@ var vm = new Vue({
el: 'body',
data: {
//Booleans

show: false,
submit: false,
error: false,
Expand Down Expand Up @@ -67,7 +67,8 @@ var vm = new Vue({
this.OneToManyBool = true;
if (this.OpenClose) {
var onData = $('#on').val();
if (inArray(onData, this.OneToManyData) || onData == null) {
var table = $('#tbl').val();
if (inArray(onData, this.OneToManyData) || !onData || inArray(table, this.OneToManyData)) {
this.errorMsg = "Something is going wrong";
this.error = true
return;
Expand Down Expand Up @@ -111,4 +112,4 @@ var vm = new Vue({
this.OneToManyData.$remove(item);
}
}
})
})

0 comments on commit 2896c2a

Please sign in to comment.