mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	Make CorpusList class ready for admin view.
This commit is contained in:
		@@ -1,11 +1,11 @@
 | 
				
			|||||||
class CorpusList extends List {
 | 
					class CorpusList extends List {
 | 
				
			||||||
  constructor(idOrElement, options) {
 | 
					  constructor(idOrElement, subscriberList, options) {
 | 
				
			||||||
    super(idOrElement, options);
 | 
					    super(idOrElement, options);
 | 
				
			||||||
    corporaSubscribers.push(this);
 | 
					    subscriberList.push(this);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _init() {
 | 
					  _init(corpora) {
 | 
				
			||||||
    for (let [id, corpus] of Object.entries(corpora)) {
 | 
					    for (let [id, corpus] of Object.entries(corpora)) {
 | 
				
			||||||
      this.addCorpus(corpus);
 | 
					      this.addCorpus(corpus);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,7 +30,7 @@
 | 
				
			|||||||
        var subscriber;
 | 
					        var subscriber;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        corpora = JSON.parse(msg);
 | 
					        corpora = JSON.parse(msg);
 | 
				
			||||||
        for (subscriber of corporaSubscribers) {subscriber._init();}
 | 
					        for (subscriber of corporaSubscribers) {subscriber._init(corpora);}
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,7 @@
 | 
				
			|||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
  var corpusList = new CorpusList("corpus-list", {
 | 
					  var corpusList = new CorpusList("corpus-list", corporaSubscribers, {
 | 
				
			||||||
    item: '<div><span class="title"></span><span class="description"></span></div>',
 | 
					    item: '<div><span class="title"></span><span class="description"></span></div>',
 | 
				
			||||||
    page: 4,
 | 
					    page: 4,
 | 
				
			||||||
    pagination: true,
 | 
					    pagination: true,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user